All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] Input: n64joy - Fix return value check in n64joy_probe()
@ 2021-03-08 12:28 'Wei Yongjun
  2021-03-08 13:42 ` Lauri Kasanen
  2021-03-08 19:40 ` Dmitry Torokhov
  0 siblings, 2 replies; 3+ messages in thread
From: 'Wei Yongjun @ 2021-03-08 12:28 UTC (permalink / raw)
  To: weiyongjun1, Dmitry Torokhov, Lauri Kasanen
  Cc: linux-input, 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: 3bdffa8ffb45 ("Input: Add N64 controller driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/input/joystick/n64joy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/joystick/n64joy.c b/drivers/input/joystick/n64joy.c
index 8bcc529942bc..9dbca366613e 100644
--- a/drivers/input/joystick/n64joy.c
+++ b/drivers/input/joystick/n64joy.c
@@ -252,8 +252,8 @@ static int __init n64joy_probe(struct platform_device *pdev)
 	mutex_init(&priv->n64joy_mutex);
 
 	priv->reg_base = devm_platform_ioremap_resource(pdev, 0);
-	if (!priv->reg_base) {
-		err = -EINVAL;
+	if (IS_ERR(priv->reg_base)) {
+		err = PTR_ERR(priv->reg_base);
 		goto fail;
 	}
 


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

* Re: [PATCH -next] Input: n64joy - Fix return value check in n64joy_probe()
  2021-03-08 12:28 [PATCH -next] Input: n64joy - Fix return value check in n64joy_probe() 'Wei Yongjun
@ 2021-03-08 13:42 ` Lauri Kasanen
  2021-03-08 19:40 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Lauri Kasanen @ 2021-03-08 13:42 UTC (permalink / raw)
  To: 'Wei Yongjun
  Cc: Dmitry Torokhov, linux-input, kernel-janitors, Hulk Robot

On Mon, 8 Mar 2021 12:28:56 +0000
'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: 3bdffa8ffb45 ("Input: Add N64 controller driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Reviewed-by: Lauri Kasanen <cand@gmx.com>

- Lauri

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

* Re: [PATCH -next] Input: n64joy - Fix return value check in n64joy_probe()
  2021-03-08 12:28 [PATCH -next] Input: n64joy - Fix return value check in n64joy_probe() 'Wei Yongjun
  2021-03-08 13:42 ` Lauri Kasanen
@ 2021-03-08 19:40 ` Dmitry Torokhov
  1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2021-03-08 19:40 UTC (permalink / raw)
  To: 'Wei Yongjun; +Cc: Lauri Kasanen, linux-input, kernel-janitors, Hulk Robot

On Mon, Mar 08, 2021 at 12:28:56PM +0000, '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: 3bdffa8ffb45 ("Input: Add N64 controller driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Applied, thank you.

-- 
Dmitry

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

end of thread, other threads:[~2021-03-08 19:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 12:28 [PATCH -next] Input: n64joy - Fix return value check in n64joy_probe() 'Wei Yongjun
2021-03-08 13:42 ` Lauri Kasanen
2021-03-08 19:40 ` Dmitry Torokhov

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.