mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()
@ 2015-04-16 12:17 weiyj_lk
  2015-04-16 13:08 ` Peter Rosin
  2015-04-17 13:21 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: weiyj_lk @ 2015-04-16 12:17 UTC (permalink / raw)
  To: Peter Rosin, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Wei Yongjun, alsa-devel, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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>
---
 sound/soc/codecs/tfa9879.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c
index 16f1b71..aab0af6 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,
 	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);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()
  2015-04-16 12:17 [PATCH] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe() weiyj_lk
@ 2015-04-16 13:08 ` Peter Rosin
  2015-04-17 13:21 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Rosin @ 2015-04-16 13:08 UTC (permalink / raw)
  To: weiyj_lk, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Wei Yongjun, alsa-devel, linux-kernel

Wei Yongjun wrote:
> 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.

Acked-by: Peter Rosin <peda@axentia.se>

Thanks,
Peter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe()
  2015-04-16 12:17 [PATCH] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe() weiyj_lk
  2015-04-16 13:08 ` Peter Rosin
@ 2015-04-17 13:21 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2015-04-17 13:21 UTC (permalink / raw)
  To: weiyj_lk
  Cc: Peter Rosin, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Wei Yongjun, alsa-devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

On Thu, Apr 16, 2015 at 08:17:46PM +0800, weiyj_lk@163.com wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> 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.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-04-17 13:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-16 12:17 [PATCH] ASoC: tfa9879: Fix return value check in tfa9879_i2c_probe() weiyj_lk
2015-04-16 13:08 ` Peter Rosin
2015-04-17 13:21 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®