Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 672371832193 ("char: xilinx_hwicap: Modernize driver probe")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dan Carpenter and committed by
Greg Kroah-Hartman
316459ba b44abdd2

+2 -2
+2 -2
drivers/char/xilinx_hwicap/xilinx_hwicap.c
··· 639 639 dev_set_drvdata(dev, drvdata); 640 640 641 641 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); 644 644 goto failed; 645 645 } 646 646