Re: [PATCH v2 01/21] usb/gadget: multi: fix error return code in cdc_do_config()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 19 2013, Andrzej Pietrasiewicz wrote:
> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
>
> Introduced by commit 59835a (usb: gadget: multi: use
> function framework for ACM.)
>
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

Having said that, one comment inline:

> ---
>  drivers/usb/gadget/multi.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c
> index 032b96a..867db32 100644
> --- a/drivers/usb/gadget/multi.c
> +++ b/drivers/usb/gadget/multi.c
> @@ -225,8 +225,10 @@ static __init int cdc_do_config(struct usb_configuration *c)
>  
>  	/* implicit port_num is zero */
>  	f_acm_multi = usb_get_function(fi_acm);
> -	if (IS_ERR(f_acm_multi))
> +	if (IS_ERR(f_acm_multi)) {
> +		ret = PTR_ERR(f_acm_multi);
>  		goto err_func_acm;
> +	}

To be honest, I would just remove the err_func_acm label and change this
to: 

	if (IS_ERR(f_acm_multi))
		return ERR_PTR(f_acm_multi);

>  
>  	ret = usb_add_function(c, f_acm_multi);
>  	if (ret)

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@xxxxxxxxxx>--------------ooO--(_)--Ooo--

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux