提交 53e720f3 编写于 作者: G Gustavo A. R. Silva 提交者: Felipe Balbi

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: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 d94e64cb
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册