From: Dan Carpenter <dan.carpenter@oracle.com>
To: ath9k-devel@qca.qualcomm.com, Christian Lamparter <chunkeey@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] ath9k: fix an IS_ERR() vs NULL check
Date: Mon, 11 Oct 2021 15:35:33 +0300 [thread overview]
Message-ID: <20211011123533.GA15188@kili> (raw)
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
next reply other threads:[~2021-10-11 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 12:35 Dan Carpenter [this message]
2021-10-13 5:48 ` [PATCH] ath9k: fix an IS_ERR() vs NULL check Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211011123533.GA15188@kili \
--to=dan.carpenter@oracle.com \
--cc=ath9k-devel@qca.qualcomm.com \
--cc=chunkeey@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox