usb: gadget: xudc: fix return value check in xudc_probe()
Subsystems (2)
PATCH 1/1 usb: gadget: xudc: fix return value check in xudc_probe()
From: Wei Yongjun <[email protected]>
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().
--- drivers/usb/gadget/udc/udc-xilinx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/udc/udc-xilinx.c +2 -2
@@ -2071,8 +2071,8 @@ static int xudc_probe(struct platform_device *pdev)/* Map the registers */ res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); udc->addr =devm_ioremap_resource (&pdev->dev, res); -if (!udc->addr) -return -ENOMEM ; +if (IS_ERR (udc->addr)) +return PTR_ERR (udc->addr); irq =platform_get_irq (pdev,0 );if (irq <0 ) {
PATCH 1/1 usb: gadget: xudc: fix return value check in xudc_probe()
Quoted 17 lines · On 04/16/2015 02:17 PM, weiyj_lk at 163.com wrote:
From: Wei Yongjun <[email protected]>
In case of error, the function
devm_ioremap_resource()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Signed-off-by Wei Yongjun <[email protected]>--- drivers/usb/gadget/udc/udc-xilinx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/gadget/udc/udc-xilinx.c +0
-0
drivers/usb/gadget/udc/udc-xilinx.c static int xudc_probe(struct platform_device *pdev) · line 2078
Quoted 10 lines
drivers/usb/gadget/udc/udc-xilinx.c +2
-2@@ -2071,8 +2071,8 @@ static int xudc_probe(struct platform_device *pdev)/* Map the registers */ res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); udc->addr =devm_ioremap_resource (&pdev->dev, res); -if (!udc->addr) -return -ENOMEM ; +if (IS_ERR (udc->addr)) +return PTR_ERR (udc->addr); irq =platform_get_irq (pdev,0 );if (irq <0 ) {
Thanks,
Michal
PATCH 1/1 usb: gadget: xudc: fix return value check in xudc_probe()
In reply to weiyj_lk at 163.comHi,
Quoted 7 lines · On Thu, Apr 16, 2015 at 08:17:30PM +0800, weiyj_lk at 163.com wrote:
From: Wei Yongjun <[email protected]>
In case of error, the function
devm_ioremap_resource()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Signed-off-by Wei Yongjun <[email protected]>
doesn't apply to v4.1-rc1, if it's still needed, please rebase.
Signature · 8 lines
balbi -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150427/d4a38313/attachment.sig>