diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-10-11 18:18:01 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2021-10-13 08:48:14 +0300 |
commit | 57671351379b2051cfb07fc14e0bead9916a0880 (patch) | |
tree | 8254641d1f96779078ec0e96f7c8b45128805305 /drivers/net/wireless/ath | |
parent | 8cd5c0847160aa9482d7f93ed63c4d72bad70cdf (diff) | |
download | linux-57671351379b2051cfb07fc14e0bead9916a0880.tar.xz |
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
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 0344d6f27275..4f00400c7ffb 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -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; |