提交 49bce159 编写于 作者: V Vladimir Zapolskiy 提交者: Felipe Balbi

usb: gadget: xilinx: fix devm_ioremap_resource() check

devm_ioremap_resource() returns IOMEM_ERR_PTR() and it never
returns NULL, fix the check to prevent access to invalid
virtual address.
Signed-off-by: NVladimir Zapolskiy <vz@mleia.com>
Reviewed-by: NSören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 22832190
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册