[PATCH 4.0 43/72] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()

From: Greg Kroah-Hartman
Date: Mon May 11 2015 - 14:50:49 EST


4.0-stable review patch. If anyone has any objections, please let me know.

------------------

From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

commit 427ced4b203dfea4f08b1298cd1f88e19039fca4 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: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
Acked-by: Peter Rosin <peda@xxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
sound/soc/codecs/tfa9879.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/sound/soc/codecs/tfa9879.c
+++ b/sound/soc/codecs/tfa9879.c
@@ -280,8 +280,8 @@ static int tfa9879_i2c_probe(struct 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);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/