Skip to content

Commit 2d8aaa1

Browse files
Wei Yongjundtor
authored andcommitted
Input: n64joy - fix return value check in n64joy_probe()
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: 3bdffa8 ("Input: Add N64 controller driver") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Lauri Kasanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 30b3f68 commit 2d8aaa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/input/joystick/n64joy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ static int __init n64joy_probe(struct platform_device *pdev)
252252
mutex_init(&priv->n64joy_mutex);
253253

254254
priv->reg_base = devm_platform_ioremap_resource(pdev, 0);
255-
if (!priv->reg_base) {
256-
err = -EINVAL;
255+
if (IS_ERR(priv->reg_base)) {
256+
err = PTR_ERR(priv->reg_base);
257257
goto fail;
258258
}
259259

0 commit comments

Comments
 (0)