Commit 47df0648 authored by Wei Yongjun's avatar Wei Yongjun Committed by Kamal Mostafa

ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()

commit 427ced4b upstream.

In case of error, the function devm_kzalloc() returns NULL
not ERR_PTR(). The IS_ERR() test in the return value check
should be replaced with NULL test.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 0b0e8512
......@@ -280,8 +280,8 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c,
int i;
tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL);
if (IS_ERR(tfa9879))
return PTR_ERR(tfa9879);
if (!tfa9879)
return -ENOMEM;
i2c_set_clientdata(i2c, tfa9879);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment