Commit 221e8360 authored by Yang Yingliang's avatar Yang Yingliang Committed by Jens Axboe

n64cart: fix return value check in n64cart_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: d9b2a2bb ("block: Add n64 cart driver")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20210909090608.2989716-1-yangyingliang@huawei.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 7f2a6a69
...@@ -129,8 +129,8 @@ static int __init n64cart_probe(struct platform_device *pdev) ...@@ -129,8 +129,8 @@ static int __init n64cart_probe(struct platform_device *pdev)
} }
reg_base = devm_platform_ioremap_resource(pdev, 0); reg_base = devm_platform_ioremap_resource(pdev, 0);
if (!reg_base) if (IS_ERR(reg_base))
return -EINVAL; return PTR_ERR(reg_base);
disk = blk_alloc_disk(NUMA_NO_NODE); disk = blk_alloc_disk(NUMA_NO_NODE);
if (!disk) if (!disk)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment