OSDN Git Service

usb: gadget: amd5536udc: fix error handling in udc_pci_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Sat, 5 Sep 2015 22:11:51 +0000 (01:11 +0300)
committerFelipe Balbi <balbi@ti.com>
Mon, 14 Sep 2015 15:14:51 +0000 (10:14 -0500)
If a failure happens early in udc_pci_probe(), error handling code
just kfree(dev) and returns. The patch adds proper resource
deallocations in udc_pci_probe() itself,
since udc_pci_remove() is not suitabe to be called so early
in initialization process.

By the way, iounmap(dev->regs) is replaced by iounmap(dev->virt_addr)
in udc_pci_remove() for clarity.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Felipe Balbi <balbi@ti.com>

No differences found