All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: samsung: i2s: Fix return value check in i2s_create_secondary_device()
@ 2019-02-16  1:20 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2019-02-16  1:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Sangbeom Kim, Sylwester Nawrocki,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors

In case of error, the function platform_device_register_simple() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Fixes: 7196c64c7d0c ("ASoC: samsung: i2s: Restore support for the secondary PCM")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/samsung/i2s.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 72f0cb7abb30..15844c00c3cd 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1342,8 +1342,8 @@ static int i2s_create_secondary_device(struct samsung_i2s_priv *priv)
 	int ret;
 
 	pdev = platform_device_register_simple("samsung-i2s-sec", -1, NULL, 0);
-	if (!pdev)
-		return -ENOMEM;
+	if (IS_ERR(pdev))
+		return PTR_ERR(pdev);
 
 	ret = device_attach(&pdev->dev);
 	if (ret < 0) {




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

* [PATCH -next] ASoC: samsung: i2s: Fix return value check in i2s_create_secondary_device()
@ 2019-02-16  1:20 ` Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: Wei Yongjun @ 2019-02-16  1:20 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Sangbeom Kim, Sylwester Nawrocki,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai
  Cc: Wei Yongjun, alsa-devel, linux-kernel, kernel-janitors

In case of error, the function platform_device_register_simple() returns
ERR_PTR() and never returns NULL. The NULL test in the return value
check should be replaced with IS_ERR().

Fixes: 7196c64c7d0c ("ASoC: samsung: i2s: Restore support for the secondary PCM")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 sound/soc/samsung/i2s.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index 72f0cb7abb30..15844c00c3cd 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -1342,8 +1342,8 @@ static int i2s_create_secondary_device(struct samsung_i2s_priv *priv)
 	int ret;
 
 	pdev = platform_device_register_simple("samsung-i2s-sec", -1, NULL, 0);
-	if (!pdev)
-		return -ENOMEM;
+	if (IS_ERR(pdev))
+		return PTR_ERR(pdev);
 
 	ret = device_attach(&pdev->dev);
 	if (ret < 0) {

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

* Re: [PATCH -next] ASoC: samsung: i2s: Fix return value check in i2s_create_secondary_device()
  2019-02-16  1:20 ` Wei Yongjun
@ 2019-02-18  8:16   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2019-02-18  8:16 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Sangbeom Kim, Sylwester Nawrocki, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
	kernel-janitors

On Sat, 16 Feb 2019 at 02:07, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> In case of error, the function platform_device_register_simple() returns
> ERR_PTR() and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().
>
> Fixes: 7196c64c7d0c ("ASoC: samsung: i2s: Restore support for the secondary PCM")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  sound/soc/samsung/i2s.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Re: [PATCH -next] ASoC: samsung: i2s: Fix return value check in i2s_create_secondary_device()
@ 2019-02-18  8:16   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2019-02-18  8:16 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Sangbeom Kim, Sylwester Nawrocki, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
	kernel-janitors

On Sat, 16 Feb 2019 at 02:07, Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> In case of error, the function platform_device_register_simple() returns
> ERR_PTR() and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().
>
> Fixes: 7196c64c7d0c ("ASoC: samsung: i2s: Restore support for the secondary PCM")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  sound/soc/samsung/i2s.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

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

* Re: [PATCH -next] ASoC: samsung: i2s: Fix return value check in i2s_create_secondary_device()
       [not found] ` <CGME20190218110447epcas1p3bb248ada6447551c1ca19f2d6af40bc4@epcas1p3.samsung.com>
@ 2019-02-18 11:04     ` Sylwester Nawrocki
  0 siblings, 0 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2019-02-18 11:04 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Krzysztof Kozlowski, Sangbeom Kim, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
	kernel-janitors

On 2/16/19 02:20, Wei Yongjun wrote:
> In case of error, the function platform_device_register_simple() returns
> ERR_PTR() and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().

Thanks for the patch, it looks good but I have already prepared other
fix that removes the platform_device_register_simple() call entirely: 

"ASoC: samsung: i2s: Fix multiple "IIS multi" devices initialization"
https://www.spinics.net/lists/kernel/msg3045092.html

-- 
Thanks,
Sylwester

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

* Re: [PATCH -next] ASoC: samsung: i2s: Fix return value check in i2s_create_secondary_device()
@ 2019-02-18 11:04     ` Sylwester Nawrocki
  0 siblings, 0 replies; 6+ messages in thread
From: Sylwester Nawrocki @ 2019-02-18 11:04 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Krzysztof Kozlowski, Sangbeom Kim, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel,
	kernel-janitors

On 2/16/19 02:20, Wei Yongjun wrote:
> In case of error, the function platform_device_register_simple() returns
> ERR_PTR() and never returns NULL. The NULL test in the return value
> check should be replaced with IS_ERR().

Thanks for the patch, it looks good but I have already prepared other
fix that removes the platform_device_register_simple() call entirely: 

"ASoC: samsung: i2s: Fix multiple "IIS multi" devices initialization"
https://www.spinics.net/lists/kernel/msg3045092.html

-- 
Thanks,
Sylwester

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

end of thread, other threads:[~2019-02-18 11:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-16  1:20 [PATCH -next] ASoC: samsung: i2s: Fix return value check in i2s_create_secondary_device() Wei Yongjun
2019-02-16  1:20 ` Wei Yongjun
2019-02-18  8:16 ` Krzysztof Kozlowski
2019-02-18  8:16   ` Krzysztof Kozlowski
     [not found] ` <CGME20190218110447epcas1p3bb248ada6447551c1ca19f2d6af40bc4@epcas1p3.samsung.com>
2019-02-18 11:04   ` Sylwester Nawrocki
2019-02-18 11:04     ` Sylwester Nawrocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.