This is a note to let you know that I've just added the patch titled usb: musb: core: properly free host / device structs in err path to the 3.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: usb-musb-core-properly-free-host-device-structs-in-err-path.patch and it can be found in the queue-3.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0d2dd7eaed1dac07b266ca2c662ff4a184a3060f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Date: Wed, 16 Oct 2013 12:50:06 +0200 Subject: usb: musb: core: properly free host / device structs in err path From: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> commit 0d2dd7eaed1dac07b266ca2c662ff4a184a3060f upstream. The patch fixes two issues in the error path cleanup: - in MUSB_PORT_MODE_DUAL_ROLE mode, if musb_gadget_setup() fails we never cleanup the host struct earlier allocated. - if musb_init_debugfs() or sysfs_create_group() fails, then we never free the host part initialization, only device part. Cc: Daniel Mack <zonque@xxxxxxxxx> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> Signed-off-by: Felipe Balbi <balbi@xxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/usb/musb/musb_core.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1947,6 +1947,8 @@ musb_init_controller(struct device *dev, if (status < 0) goto fail3; status = musb_gadget_setup(musb); + if (status) + musb_host_cleanup(musb); break; default: dev_err(dev, "unsupported port mode %d\n", musb->port_mode); @@ -1973,6 +1975,7 @@ fail5: fail4: musb_gadget_cleanup(musb); + musb_host_cleanup(musb); fail3: if (musb->dma_controller) Patches currently in stable-queue which might be from bigeasy@xxxxxxxxxxxxx are queue-3.12/usb-musb-call-musb_start-only-once-in-otg-mode.patch queue-3.12/usb-musb-core-properly-free-host-device-structs-in-err-path.patch queue-3.12/usb-musb-cancel-work-on-removal.patch queue-3.12/usb-musb-dsps-move-try_idle-to-start-hook.patch queue-3.12/usb-musb-dsps-redo-the-otg-timer.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html