ath9k: fix an IS_ERR() vs NULL check
The devm_kmemdup() function doesn't return error pointers, it returns NULL on error. Fixes: eb3a97a69be8 ("ath9k: fetch calibration data via nvmem subsystem") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20211011123533.GA15188@kili
This commit is contained in:
parent
8cd5c08471
commit
5767135137
@ -610,8 +610,8 @@ static int ath9k_nvmem_request_eeprom(struct ath_softc *sc)
|
||||
/* devres manages the calibration values release on shutdown */
|
||||
ah->nvmem_blob = (u16 *)devm_kmemdup(sc->dev, buf, len, GFP_KERNEL);
|
||||
kfree(buf);
|
||||
if (IS_ERR(ah->nvmem_blob))
|
||||
return PTR_ERR(ah->nvmem_blob);
|
||||
if (!ah->nvmem_blob)
|
||||
return -ENOMEM;
|
||||
|
||||
ah->nvmem_blob_len = len;
|
||||
ah->ah_flags &= ~AH_USE_EEPROM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user