diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2015-04-16 08:17:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-04-17 09:21:04 -0400 |
commit | 427ced4b203dfea4f08b1298cd1f88e19039fca4 (patch) | |
tree | 26d256aca95ffc489b1246e2104366d8cff255a3 | |
parent | c517d838eb7d07bbe9507871fab3931deccff539 (diff) |
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: 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
-rw-r--r-- | sound/soc/codecs/tfa9879.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c index 16f1b71edb55..aab0af681e8c 100644 --- a/sound/soc/codecs/tfa9879.c +++ b/sound/soc/codecs/tfa9879.c | |||
@@ -280,8 +280,8 @@ static int tfa9879_i2c_probe(struct i2c_client *i2c, | |||
280 | int i; | 280 | int i; |
281 | 281 | ||
282 | tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL); | 282 | tfa9879 = devm_kzalloc(&i2c->dev, sizeof(*tfa9879), GFP_KERNEL); |
283 | if (IS_ERR(tfa9879)) | 283 | if (!tfa9879) |
284 | return PTR_ERR(tfa9879); | 284 | return -ENOMEM; |
285 | 285 | ||
286 | i2c_set_clientdata(i2c, tfa9879); | 286 | i2c_set_clientdata(i2c, tfa9879); |
287 | 287 | ||