提交 427ced4b 编写于 作者: W Wei Yongjun 提交者: Mark Brown

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

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: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: NPeter Rosin <peda@axentia.se>
Signed-off-by: NMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
上级 c517d838
...@@ -280,8 +280,8 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c, ...@@ -280,8 +280,8 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c,
int i; int i;
tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL); tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL);
if (IS_ERR(tfa9879)) if (!tfa9879)
return PTR_ERR(tfa9879); return -ENOMEM;
i2c_set_clientdata(i2c, tfa9879); i2c_set_clientdata(i2c, tfa9879);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册