kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix an IS_ERR() vs NULL check
@ 2021-10-11 12:35 Dan Carpenter
  2021-10-13  5:48 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2021-10-11 12:35 UTC (permalink / raw)
  To: ath9k-devel, Christian Lamparter
  Cc: Kalle Valo, linux-wireless, kernel-janitors

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>
---
 drivers/net/wireless/ath/ath9k/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 1568730fc01e..335e10133926 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;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ath9k: fix an IS_ERR() vs NULL check
  2021-10-11 12:35 [PATCH] ath9k: fix an IS_ERR() vs NULL check Dan Carpenter
@ 2021-10-13  5:48 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-10-13  5:48 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: ath9k-devel, Christian Lamparter, linux-wireless, kernel-janitors

Dan Carpenter <dan.carpenter@oracle.com> wrote:

> 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>

Patch applied to ath-next branch of ath.git, thanks.

57671351379b ath9k: fix an IS_ERR() vs NULL check

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211011123533.GA15188@kili/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-13  5:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11 12:35 [PATCH] ath9k: fix an IS_ERR() vs NULL check Dan Carpenter
2021-10-13  5:48 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).