1
0
Fork 0

usb: gadget: udc: lpc32xx: fix return value check in lpc32xx_udc_probe()

In case of error, the function devm_ioremap_resource() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check should
be replaced with IS_ERR().

This issue was detected by using the Coccinelle software.

Fixes: 408b56ca5c ("usb: gadget: udc: lpc32xx: simplify probe")
Acked-by: Sylvain Lemieux <slemieux.tyco@gmail.com>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
hifive-unleashed-5.2
Wei Yongjun 2019-05-04 07:04:07 +00:00 committed by Felipe Balbi
parent 066cfd0770
commit 42cc68868c
1 changed files with 2 additions and 2 deletions

View File

@ -3069,9 +3069,9 @@ static int lpc32xx_udc_probe(struct platform_device *pdev)
}
udc->udp_baseaddr = devm_ioremap_resource(dev, res);
if (!udc->udp_baseaddr) {
if (IS_ERR(udc->udp_baseaddr)) {
dev_err(udc->dev, "IO map failure\n");
return -ENOMEM;
return PTR_ERR(udc->udp_baseaddr);
}
/* Get USB device clock */