* [PATCH -next] n64: fix return value check in n64cart_probe()
@ 2021-02-23 14:01 Wei Yongjun
2021-02-23 14:56 ` Lauri Kasanen
2021-02-23 19:32 ` Chaitanya Kulkarni
0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-02-23 14:01 UTC (permalink / raw)
To: Hulk Robot, Jens Axboe, Lauri Kasanen; +Cc: Wei Yongjun, linux-block
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: d9b2a2bbbb4d ("block: Add n64 cart driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/block/n64cart.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c
index 47bdf324e962..84a0f8d0be29 100644
--- a/drivers/block/n64cart.c
+++ b/drivers/block/n64cart.c
@@ -129,8 +129,8 @@ static int __init n64cart_probe(struct platform_device *pdev)
}
reg_base = devm_platform_ioremap_resource(pdev, 0);
- if (!reg_base)
- return -EINVAL;
+ if (IS_ERR(reg_base))
+ return ERR_PTR(reg_base);
disk = alloc_disk(0);
if (!disk)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] n64: fix return value check in n64cart_probe()
2021-02-23 14:01 [PATCH -next] n64: fix return value check in n64cart_probe() Wei Yongjun
@ 2021-02-23 14:56 ` Lauri Kasanen
2021-02-23 19:32 ` Chaitanya Kulkarni
1 sibling, 0 replies; 3+ messages in thread
From: Lauri Kasanen @ 2021-02-23 14:56 UTC (permalink / raw)
To: Wei Yongjun; +Cc: Hulk Robot, Jens Axboe, linux-block
On Tue, 23 Feb 2021 14:01:04 +0000
Wei Yongjun <weiyongjun1@huawei.com> wrote:
> 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: d9b2a2bbbb4d ("block: Add n64 cart driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/block/n64cart.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/n64cart.c b/drivers/block/n64cart.c
> index 47bdf324e962..84a0f8d0be29 100644
> --- a/drivers/block/n64cart.c
> +++ b/drivers/block/n64cart.c
> @@ -129,8 +129,8 @@ static int __init n64cart_probe(struct platform_device *pdev)
> }
>
> reg_base = devm_platform_ioremap_resource(pdev, 0);
> - if (!reg_base)
> - return -EINVAL;
> + if (IS_ERR(reg_base))
> + return ERR_PTR(reg_base);
>
> disk = alloc_disk(0);
> if (!disk)
>
Reviewed-by: Lauri Kasanen <cand@gmx.com>
- Lauri
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] n64: fix return value check in n64cart_probe()
2021-02-23 14:01 [PATCH -next] n64: fix return value check in n64cart_probe() Wei Yongjun
2021-02-23 14:56 ` Lauri Kasanen
@ 2021-02-23 19:32 ` Chaitanya Kulkarni
1 sibling, 0 replies; 3+ messages in thread
From: Chaitanya Kulkarni @ 2021-02-23 19:32 UTC (permalink / raw)
To: Wei Yongjun, Hulk Robot, Jens Axboe, Lauri Kasanen; +Cc: linux-block
On 2/23/21 05:55, Wei Yongjun wrote:
> 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: d9b2a2bbbb4d ("block: Add n64 cart driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Looks good.
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-23 19:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-23 14:01 [PATCH -next] n64: fix return value check in n64cart_probe() Wei Yongjun
2021-02-23 14:56 ` Lauri Kasanen
2021-02-23 19:32 ` Chaitanya Kulkarni
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.