]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitbe51adb2e2b66d3be90a65b9158f31f3147df13a
tree730081fef49686041d37fba0bd46793b3c4d9225
parent5662af3e520abb8949b7096c25471aca559abd1d
usb: gadget: amd5536udc: fix error handling in udc_pci_probe()

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>
drivers/usb/gadget/udc/amd5536udc.c