diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-05-02 18:37:22 +0200 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-05-17 13:16:20 +0200 |
commit | 53e720f332d546dee5a98a55f6e532355727bc4d (patch) | |
tree | d974433230af4267f9f071320e08653249ab64b2 /drivers/usb/gadget/udc/net2280.c | |
parent | usb: phy: phy-msm-usb: Remove redundant extcon register/unregister (diff) | |
download | linux-53e720f332d546dee5a98a55f6e532355727bc4d.tar.xz linux-53e720f332d546dee5a98a55f6e532355727bc4d.zip |
usb: gadget: udc: add null check before pointer dereference
Add null check before dereferencing dev->regs pointer inside
net2280_led_shutdown() function.
Addresses-Coverity-ID: 101783
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget/udc/net2280.c')
-rw-r--r-- | drivers/usb/gadget/udc/net2280.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 6cf07857eaca..29c3d11a0e1d 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -3573,7 +3573,6 @@ static void net2280_remove(struct pci_dev *pdev) BUG_ON(dev->driver); /* then clean up the resources we allocated during probe() */ - net2280_led_shutdown(dev); if (dev->requests) { int i; for (i = 1; i < 5; i++) { @@ -3588,8 +3587,10 @@ static void net2280_remove(struct pci_dev *pdev) free_irq(pdev->irq, dev); if (dev->quirks & PLX_PCIE) pci_disable_msi(pdev); - if (dev->regs) + if (dev->regs) { + net2280_led_shutdown(dev); iounmap(dev->regs); + } if (dev->region) release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); |