All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe()
@ 2021-03-05  3:49 ` 'Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: 'Wei Yongjun @ 2021-03-05  3:49 UTC (permalink / raw)
  To: weiyongjun1, Felipe Balbi, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Nathan Chancellor, Nick Desaulniers,
	Gustavo A. R. Silva, Arnd Bergmann
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, kernel-janitors,
	Hulk Robot

From: Wei Yongjun <weiyongjun1@huawei.com>

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

Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/usb/gadget/udc/s3c2410_udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c
index f1ea51476add..1d3ebb07ccd4 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -1773,8 +1773,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
 	udc_info = dev_get_platdata(&pdev->dev);
 
 	base_addr = devm_platform_ioremap_resource(pdev, 0);
-	if (!base_addr) {
-		retval = -ENOMEM;
+	if (IS_ERR(base_addr)) {
+		retval = PTR_ERR(base_addr);
 		goto err_mem;
 	}
 


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

* [PATCH -next] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe()
@ 2021-03-05  3:49 ` 'Wei Yongjun
  0 siblings, 0 replies; 6+ messages in thread
From: 'Wei Yongjun @ 2021-03-05  3:49 UTC (permalink / raw)
  To: weiyongjun1, Felipe Balbi, Greg Kroah-Hartman,
	Krzysztof Kozlowski, Nathan Chancellor, Nick Desaulniers,
	Gustavo A. R. Silva, Arnd Bergmann
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, kernel-janitors,
	Hulk Robot

From: Wei Yongjun <weiyongjun1@huawei.com>

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

Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/usb/gadget/udc/s3c2410_udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/s3c2410_udc.c b/drivers/usb/gadget/udc/s3c2410_udc.c
index f1ea51476add..1d3ebb07ccd4 100644
--- a/drivers/usb/gadget/udc/s3c2410_udc.c
+++ b/drivers/usb/gadget/udc/s3c2410_udc.c
@@ -1773,8 +1773,8 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
 	udc_info = dev_get_platdata(&pdev->dev);
 
 	base_addr = devm_platform_ioremap_resource(pdev, 0);
-	if (!base_addr) {
-		retval = -ENOMEM;
+	if (IS_ERR(base_addr)) {
+		retval = PTR_ERR(base_addr);
 		goto err_mem;
 	}
 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH -next] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe()
  2021-03-05  3:49 ` 'Wei Yongjun
@ 2021-03-05  8:07   ` Arnd Bergmann
  -1 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2021-03-05  8:07 UTC (permalink / raw)
  To: 'Wei Yongjun
  Cc: Felipe Balbi, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Nathan Chancellor, Nick Desaulniers, Gustavo A. R. Silva,
	USB list, Linux ARM,
	moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	kernel-janitors, Hulk Robot

On Fri, Mar 5, 2021 at 4:49 AM 'Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function devm_platform_ioremap_resource()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().
>
> Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Nice find, thanks for fixing it!

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH -next] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe()
@ 2021-03-05  8:07   ` Arnd Bergmann
  0 siblings, 0 replies; 6+ messages in thread
From: Arnd Bergmann @ 2021-03-05  8:07 UTC (permalink / raw)
  To: 'Wei Yongjun
  Cc: Felipe Balbi, Greg Kroah-Hartman, Krzysztof Kozlowski,
	Nathan Chancellor, Nick Desaulniers, Gustavo A. R. Silva,
	USB list, Linux ARM,
	moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	kernel-janitors, Hulk Robot

On Fri, Mar 5, 2021 at 4:49 AM 'Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> From: Wei Yongjun <weiyongjun1@huawei.com>
>
> In case of error, the function devm_platform_ioremap_resource()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().
>
> Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Nice find, thanks for fixing it!

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH -next] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe()
  2021-03-05  3:49 ` 'Wei Yongjun
@ 2021-03-05 10:10   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-05 10:10 UTC (permalink / raw)
  To: 'Wei Yongjun, Felipe Balbi, Greg Kroah-Hartman,
	Nathan Chancellor, Nick Desaulniers, Gustavo A. R. Silva,
	Arnd Bergmann
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, kernel-janitors,
	Hulk Robot

On 05/03/2021 04:49, 'Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> In case of error, the function devm_platform_ioremap_resource()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().
> 
> Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof

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

* Re: [PATCH -next] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe()
@ 2021-03-05 10:10   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2021-03-05 10:10 UTC (permalink / raw)
  To: 'Wei Yongjun, Felipe Balbi, Greg Kroah-Hartman,
	Nathan Chancellor, Nick Desaulniers, Gustavo A. R. Silva,
	Arnd Bergmann
  Cc: linux-usb, linux-arm-kernel, linux-samsung-soc, kernel-janitors,
	Hulk Robot

On 05/03/2021 04:49, 'Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> In case of error, the function devm_platform_ioremap_resource()
> returns ERR_PTR() and never returns NULL. The NULL test in the
> return value check should be replaced with IS_ERR().
> 
> Fixes: 188db4435ac6 ("usb: gadget: s3c: use platform resources")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-03-05 10:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05  3:49 [PATCH -next] USB: gadget: udc: s3c2410_udc: fix return value check in s3c2410_udc_probe() 'Wei Yongjun
2021-03-05  3:49 ` 'Wei Yongjun
2021-03-05  8:07 ` Arnd Bergmann
2021-03-05  8:07   ` Arnd Bergmann
2021-03-05 10:10 ` Krzysztof Kozlowski
2021-03-05 10:10   ` Krzysztof Kozlowski

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.