summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorXi Wang <xi.wang@gmail.com>2012-11-15 10:21:01 +0100
committerFelipe Balbi <balbi@ti.com>2012-12-13 11:03:55 +0100
commit25e14c1fcce5c66b0d2d5e35fad35d044dc320ae (patch)
treea4741eb3db959b34d74fd29457fa459ff1faac7e /drivers/usb
parentusb: musb: dsps: header movement build error fix (diff)
downloadlinux-25e14c1fcce5c66b0d2d5e35fad35d044dc320ae.tar.xz
linux-25e14c1fcce5c66b0d2d5e35fad35d044dc320ae.zip
usb: gadget: amd5536udc: avoid NULL pointer dereference in udc_pci_probe()
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/amd5536udc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index fc0ec5e0d58e..d9f6b9372491 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -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;