提交 2d8aaa17 编写于 作者: W Wei Yongjun 提交者: Dmitry Torokhov

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: 3bdffa8f ("Input: Add N64 controller driver")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NLauri Kasanen <cand@gmx.com>
Link: https://lore.kernel.org/r/20210308122856.2177071-1-weiyongjun1@huawei.comSigned-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 30b3f687
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册