[PATCH] usb: gadget: storage: release superspeed descriptors.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Release superspeed mass storage descriptors memory
when the function is unbind.

Change-Id: Iffc278621266bf82abee38675494338351c0978e
Signed-off-by: Yu Xu <yuxu@xxxxxxxxxxx>
---
 drivers/usb/gadget/f_mass_storage.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index a18ebee..987ec79 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -2987,6 +2987,9 @@ static void fsg_unbind(struct usb_configuration *c, struct usb_function *f)
 	fsg_common_put(common);
 	usb_free_descriptors(fsg->function.descriptors);
 	usb_free_descriptors(fsg->function.hs_descriptors);
+	if (gadget_is_superspeed(fsg->common->gadget))
+		usb_free_descriptors(fsg->function.ss_descriptors);
+
 	kfree(fsg);
 }
 
-- 
1.7.5.4

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux