]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: codecs: Fix error check in es8323_i2c_probe
authorTang Bin <tangbin@cmss.chinamobile.com>
Fri, 11 Oct 2024 07:31:15 +0000 (15:31 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 11 Oct 2024 10:22:46 +0000 (11:22 +0100)
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>
sound/soc/codecs/es8323.c

index c09bd92b2ed319631645ccd2bc8057bc7eef07aa..6f4fa36ea34d6704b591a34df18e623982903256 100644 (file)
@@ -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);