[PATCH master 6/6] usb: gadget: multi: free UMS instance at multi_unbind time

Ahmad Fatoum a.fatoum at pengutronix.de
Sat Mar 19 04:02:46 PDT 2022


We do this for all other gadgets, but not for UMS. Fix this.

Fixes: 57313f83e83e ("usbgadget: add support for USB mass storage gadget")
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/usb/gadget/multi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
index cd5b529d3eba..102d8714f86d 100644
--- a/drivers/usb/gadget/multi.c
+++ b/drivers/usb/gadget/multi.c
@@ -169,6 +169,11 @@ static int multi_unbind(struct usb_composite_dev *cdev)
 		usb_put_function_instance(fi_acm);
 	}
 
+	if (gadget_multi_opts->ums_opts.files) {
+		usb_put_function(f_ums);
+		usb_put_function_instance(fi_ums);
+	}
+
 	if (gadget_multi_opts->dfu_opts.files) {
 		usb_put_function(f_dfu);
 		usb_put_function_instance(fi_dfu);
-- 
2.30.2




More information about the barebox mailing list