Skip to content

Commit 316459b

Browse files
Dan Carpentergregkh
authored andcommitted
char: xilinx_hwicap: Fix NULL vs IS_ERR() bug
The devm_platform_ioremap_resource() function returns error pointers. It never returns NULL. Update the check accordingly. Fixes: 6723718 ("char: xilinx_hwicap: Modernize driver probe") Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b44abdd commit 316459b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/char/xilinx_hwicap/xilinx_hwicap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,8 +639,8 @@ static int hwicap_setup(struct platform_device *pdev, int id,
639639
dev_set_drvdata(dev, drvdata);
640640

641641
drvdata->base_address = devm_platform_ioremap_resource(pdev, 0);
642-
if (!drvdata->base_address) {
643-
retval = -ENODEV;
642+
if (IS_ERR(drvdata->base_address)) {
643+
retval = PTR_ERR(drvdata->base_address);
644644
goto failed;
645645
}
646646

0 commit comments

Comments
 (0)