Skip to content

Commit 221e836

Browse files
Yang Yingliangaxboe
authored andcommitted
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: d9b2a2b ("block: Add n64 cart driver") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 7f2a6a6 commit 221e836

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/block/n64cart.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ static int __init n64cart_probe(struct platform_device *pdev)
129129
}
130130

131131
reg_base = devm_platform_ioremap_resource(pdev, 0);
132-
if (!reg_base)
133-
return -EINVAL;
132+
if (IS_ERR(reg_base))
133+
return PTR_ERR(reg_base);
134134

135135
disk = blk_alloc_disk(NUMA_NO_NODE);
136136
if (!disk)

0 commit comments

Comments
 (0)