usb: gadget: zero: fix error return code in zero_bind()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 25 Apr 2013 09:29:05 +0000 (17:29 +0800)
committerFelipe Balbi <balbi@ti.com>
Wed, 15 May 2013 14:15:57 +0000 (17:15 +0300)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Introduced by commit cf9a08ae5aece88987bbeee8eb0dd0ebb5015815
(usb: gadget: convert source sink and loopback to new function interface)

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/zero.c

index 2cd6262e8b7149a23d8458e76e5ef6ef3b919f1c..0deb9d6cde26245fd1c52c0b541eecd100aedce6 100644 (file)
@@ -284,12 +284,16 @@ static int __init zero_bind(struct usb_composite_dev *cdev)
        ss_opts->bulk_buflen = gzero_options.bulk_buflen;
 
        func_ss = usb_get_function(func_inst_ss);
-       if (IS_ERR(func_ss))
+       if (IS_ERR(func_ss)) {
+               status = PTR_ERR(func_ss);
                goto err_put_func_inst_ss;
+       }
 
        func_inst_lb = usb_get_function_instance("Loopback");
-       if (IS_ERR(func_inst_lb))
+       if (IS_ERR(func_inst_lb)) {
+               status = PTR_ERR(func_inst_lb);
                goto err_put_func_ss;
+       }
 
        lb_opts = container_of(func_inst_lb, struct f_lb_opts, func_inst);
        lb_opts->bulk_buflen = gzero_options.bulk_buflen;