This series reworks resource cleanup during probe and removal in the
Freescale USB2 gadget driver.

The cleanup review also found that an error path in struct_udc_setup()
frees coherent DMA memory with kfree(). Patch 1 handles this separately.

Patch 1 fixes the DMA queue head cleanup in struct_udc_setup().
Patch 2 fixes the gadget lifetime and resource leaks on probe failure.
Patch 3 moves IRQ registration after resource allocation and before the
queue head address is written to the controller.

Compile-test passed.

Wanhui Fu (3):
  usb: gadget: fsl_udc: Fix incorrect freeing of DMA queue heads
  usb: gadget: fsl_udc: Fix gadget lifetime and probe resource leaks
  usb: gadget: fsl_udc: Register IRQ after allocating controller
    resources

 drivers/usb/gadget/udc/fsl_udc_core.c | 99 ++++++++++++++++-----------
 1 file changed, 58 insertions(+), 41 deletions(-)


base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
-- 
2.25.1


Reply via email to