diff options
author | Tang Bin <tangbin@cmss.chinamobile.com> | 2024-10-11 15:31:15 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-10-11 11:22:46 +0100 |
commit | c1789209701143b50cba3783fa800a23df30a088 (patch) | |
tree | 2bfc17d2341e2960a2966d6c4ab1afe6062a86df | |
parent | a0aae96be5ffc5b456ca07bfe1385b721c20e184 (diff) |
ASoC: codecs: Fix error check in es8323_i2c_probe
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>
Link: https://patch.msgid.link/20241011073115.2384-1-tangbin@cmss.chinamobile.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/es8323.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c index c09bd92b2ed3..6f4fa36ea34d 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); |