usb: gadget: zero: put function instances on unbind
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Thu, 18 Apr 2013 12:43:26 +0000 (14:43 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 23 Apr 2013 11:12:21 +0000 (14:12 +0300)
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 <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/zero.c

index 685fa681cb6542abcea1f3b3fb02218201019551..2cd6262e8b7149a23d8458e76e5ef6ef3b919f1c 100644 (file)
@@ -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;
 }