Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 427ced4b authored by Wei Yongjun's avatar Wei Yongjun Committed by Mark Brown
Browse files

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: 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>
Cc: stable@vger.kernel.org
parent c517d838
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);