Skip to content

Commit

Permalink
usb: gadget: cdc2: fix error return code in cdc_do_config()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Felipe Balbi committed Apr 23, 2013
1 parent ad46047 commit 8d6f51b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/gadget/cdc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8d6f51b

Please sign in to comment.