usb: gadget: cdc2: fix error return code in cdc_do_config()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sat, 6 Apr 2013 09:25:21 +0000 (17:25 +0800)
committerFelipe Balbi <balbi@ti.com>
Tue, 23 Apr 2013 11:11:51 +0000 (14:11 +0300)
Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.

Introduced by commit 29a664 (usb: gadget: cdc2: use function
framework for ACM)

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

index c6ee6f1558c390454e13a0a2008e2a0836f407e2..2c52551827692c5bd119bf78513e32e3f0fd7116 100644 (file)
@@ -129,8 +129,10 @@ static int __init cdc_do_config(struct usb_configuration *c)
                return PTR_ERR(fi_serial);
 
        f_acm = usb_get_function(fi_serial);
-       if (IS_ERR(f_acm))
+       if (IS_ERR(f_acm)) {
+               status = PTR_ERR(f_acm);
                goto err_func_acm;
+       }
 
        status = usb_add_function(c, f_acm);
        if (status)