Re: [PATCH -next] usb: gadget: zero: fix error return code in zero_bind()

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

 



On Thu, Apr 25 2013, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
>
> 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)
>
> Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

> ---
>  drivers/usb/gadget/zero.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
> index 2cd6262..0deb9d6 100644
> --- a/drivers/usb/gadget/zero.c
> +++ b/drivers/usb/gadget/zero.c
> @@ -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;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
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: pgpQu9fVc0Sah.pgp
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