From abe7a4097dd0141d21d02e4bd949b377a0a75120 Mon Sep 17 00:00:00 2001 From: Andrzej Pietrasiewicz Date: Thu, 18 Apr 2013 14:43:26 +0200 Subject: [PATCH] usb: gadget: zero: put function instances on unbind If function instances are not put on gadget's unbind, their implementation module's refcount is nonzero and it is impossible to unload them. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Kyungmin Park Signed-off-by: Felipe Balbi --- drivers/usb/gadget/zero.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index 685fa681cb6..2cd6262e8b7 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -368,8 +368,10 @@ static int zero_unbind(struct usb_composite_dev *cdev) del_timer_sync(&autoresume_timer); if (!IS_ERR_OR_NULL(func_ss)) usb_put_function(func_ss); + usb_put_function_instance(func_inst_ss); if (!IS_ERR_OR_NULL(func_lb)) usb_put_function(func_lb); + usb_put_function_instance(func_inst_lb); return 0; } -- 2.41.0