usb: gadget: amd5536udc: avoid NULL pointer dereference in udc_pci_probe()
authorXi Wang <xi.wang@gmail.com>
Thu, 15 Nov 2012 09:21:01 +0000 (04:21 -0500)
committerFelipe Balbi <balbi@ti.com>
Thu, 13 Dec 2012 10:03:55 +0000 (12:03 +0200)
dev->pdev is NULL before `dev->pdev = pdev'; use pdev instead.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/amd5536udc.c

index fc0ec5e..d9f6b93 100644 (file)
@@ -3231,7 +3231,7 @@ static int udc_pci_probe(
        }
 
        if (!pdev->irq) {
-               dev_err(&dev->pdev->dev, "irq not set\n");
+               dev_err(&pdev->dev, "irq not set\n");
                kfree(dev);
                dev = NULL;
                retval = -ENODEV;
@@ -3250,7 +3250,7 @@ static int udc_pci_probe(
        dev->txfifo = (u32 __iomem *)(dev->virt_addr + UDC_TXFIFO_ADDR);
 
        if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
-               dev_dbg(&dev->pdev->dev, "request_irq(%d) fail\n", pdev->irq);
+               dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq);
                kfree(dev);
                dev = NULL;
                retval = -EBUSY;