The MUSB glue drivers below allocate the struct musb with
musb_init_controller() in their host probe and return the error when
musb_lowlevel_init() fails, for example when no device is connected.
None of them frees the struct musb on that path, and the driver core
then frees the private data that holds the only pointer to it, so each
'usb reset', or 'usb start' after 'usb stop', leaks another one. This
series frees it in ux500, sc5xx, pic32, omap2430, ti-musb and da8xx.

The same fix for sunxi and mt85xx was sent as separate patches:
"usb: musb-new: sunxi: Free the controller if the host probe fails"
"usb: musb-new: mt85xx: Free the controller if the host probe fails"

The patches are independent of each other. They are build-tested only,
as noted in each patch, and pic32 is not built at all. None was tested
on hardware.

Yuho Choi (6):
  usb: musb-new: ux500: Free the controller if the host probe fails
  usb: musb-new: sc5xx: Free the controller if the host probe fails
  usb: musb-new: pic32: Free the controller if the host probe fails
  usb: musb-new: omap2430: Free the controller if the host probe fails
  usb: musb-new: ti-musb: Free the controller if the host probe fails
  usb: musb-new: da8xx: Free the controller if the host probe fails

 drivers/usb/musb-new/da8xx.c    | 2 ++
 drivers/usb/musb-new/omap2430.c | 6 +++++-
 drivers/usb/musb-new/pic32.c    | 2 ++
 drivers/usb/musb-new/sc5xx.c    | 2 ++
 drivers/usb/musb-new/ti-musb.c  | 2 ++
 drivers/usb/musb-new/ux500.c    | 6 +++++-
 6 files changed, 18 insertions(+), 2 deletions(-)


base-commit: feb8913982e4462c01fd914271f92254a25dc101
-- 
2.43.0

Reply via email to