From: Tang Bin <tangbin@cmss.chinamobile.com>
To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
Tang Bin <tangbin@cmss.chinamobile.com>
Subject: [PATCH] ASoC: codecs: Fix error check in es8323_i2c_probe
Date: Fri, 11 Oct 2024 15:31:15 +0800 [thread overview]
Message-ID: <20241011073115.2384-1-tangbin@cmss.chinamobile.com> (raw)
In the function es8323_i2c_probe(), devm_kzalloc() could
possibly return NULL pointer, so IS_ERR() is wrong check
in this place, thus fix it.
Fixes: b97391a604b9 ("ASoC: codecs: Add support for ES8323")
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
---
sound/soc/codecs/es8323.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c
index c09bd92b2..6f4fa36ea 100644
--- a/sound/soc/codecs/es8323.c
+++ b/sound/soc/codecs/es8323.c
@@ -743,7 +743,7 @@ static int es8323_i2c_probe(struct i2c_client *i2c_client)
struct device *dev = &i2c_client->dev;
es8323 = devm_kzalloc(dev, sizeof(*es8323), GFP_KERNEL);
- if (IS_ERR(es8323))
+ if (!es8323)
return -ENOMEM;
i2c_set_clientdata(i2c_client, es8323);
--
2.33.0
next reply other threads:[~2024-10-11 7:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-11 7:31 Tang Bin [this message]
2024-10-11 12:59 ` Mark Brown
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=20241011073115.2384-1-tangbin@cmss.chinamobile.com \
--to=tangbin@cmss.chinamobile.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/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
all inboxes | Powered by JetHome®