From: Nicholas Bellinger <[email protected]>

This patch adds the missing tcm_usbg_drop_nexus() to properly
release tcm_usbg_nexus memory during typical ->fabric_drop_tpg()
callback shutdown.

Reported-by: Andrzej Pietrasiewicz <[email protected]>
Cc: Andrzej Pietrasiewicz <[email protected]>
Cc: Sebastian Andrzej Siewior <[email protected]>
Signed-off-by: Nicholas Bellinger <[email protected]>
[split unrelated changes into separate patches]
Signed-off-by: Andrzej Pietrasiewicz <[email protected]>
---
 drivers/usb/gadget/legacy/tcm_usb_gadget.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c 
b/drivers/usb/gadget/legacy/tcm_usb_gadget.c
index edc74d3..e90d3c9 100644
--- a/drivers/usb/gadget/legacy/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/legacy/tcm_usb_gadget.c
@@ -1423,11 +1423,14 @@ static struct se_portal_group *usbg_make_tpg(
        return &tpg->se_tpg;
 }
 
+static int tcm_usbg_drop_nexus(struct usbg_tpg *);
+
 static void usbg_drop_tpg(struct se_portal_group *se_tpg)
 {
        struct usbg_tpg *tpg = container_of(se_tpg,
                                struct usbg_tpg, se_tpg);
 
+       tcm_usbg_drop_nexus(tpg);
        core_tpg_deregister(se_tpg);
        destroy_workqueue(tpg->workqueue);
        kfree(tpg);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to