diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-12-11 16:06:14 +0100 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-12-20 19:40:19 -0800 |
commit | 4fef4e43558af8e880356c2893616bcee8b32867 (patch) | |
tree | 214c6b39d4739408bea4afb3b7afe4401850c3b1 /drivers/usb | |
parent | a0841d447ccc5685852b560a7b0919f4011ec111 (diff) | |
download | linux-4fef4e43558af8e880356c2893616bcee8b32867.tar.gz linux-4fef4e43558af8e880356c2893616bcee8b32867.tar.bz2 linux-4fef4e43558af8e880356c2893616bcee8b32867.zip |
tcm_usb_gadget: Fix nexus leak
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 <andrzej.p@samsung.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/legacy/tcm_usb_gadget.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/legacy/tcm_usb_gadget.c b/drivers/usb/gadget/legacy/tcm_usb_gadget.c index edc74d347d98..e90d3c917e0b 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); |