diff options
author | Xi Wang <xi.wang@gmail.com> | 2012-11-15 04:21:01 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-12-13 12:03:55 +0200 |
commit | 25e14c1fcce5c66b0d2d5e35fad35d044dc320ae (patch) | |
tree | a4741eb3db959b34d74fd29457fa459ff1faac7e /drivers/usb/gadget/amd5536udc.c | |
parent | deeeb9ee1ed5b06864f530c6123976209badd489 (diff) | |
download | linux-3.10-25e14c1fcce5c66b0d2d5e35fad35d044dc320ae.tar.gz linux-3.10-25e14c1fcce5c66b0d2d5e35fad35d044dc320ae.tar.bz2 linux-3.10-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/gadget/amd5536udc.c')
-rw-r--r-- | drivers/usb/gadget/amd5536udc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c index fc0ec5e0d58..d9f6b937249 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; |