Skip to content

Commit

Permalink
ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()
Browse files Browse the repository at this point in the history
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: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
  • Loading branch information
Wei Yongjun authored and Mark Brown committed Apr 17, 2015
1 parent c517d83 commit 427ced4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/codecs/tfa9879.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 427ced4

Please sign in to comment.