lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <53ee397a-ef2e-4248-8d32-52c8d1e138e9@huawei.com>
Date:   Thu, 12 Nov 2020 21:23:04 +0800
From:   chenzhou <chenzhou10@...wei.com>
To:     <balbi@...nel.org>
CC:     <gregkh@...uxfoundation.org>, <weiyongjun1@...wei.com>,
        <jun.li@...escale.com>, <rogerq@...com>,
        <linux-usb@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Hulk Robot <hulkci@...wei.com>
Subject: Re: [PATCH] usb: gadget: mass_storage: fix error return code in
 msg_bind()



On 2020/11/12 16:53, Chen Zhou wrote:
> Fix to return a negative error code from the error handling case
> instead of 0 in function msg_bind(), as done elsewhere in this
> function.
>
> Fixes: d86788979761 ("usb: gadget: mass_storage: allocate and init otg descriptor by otg capabilities")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Chen Zhou <chenzhou10@...wei.com>
> ---
>  drivers/usb/gadget/legacy/mass_storage.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/legacy/mass_storage.c b/drivers/usb/gadget/legacy/mass_storage.c
> index 9ed22c5fb7fe..7a88c5282d61 100644
> --- a/drivers/usb/gadget/legacy/mass_storage.c
> +++ b/drivers/usb/gadget/legacy/mass_storage.c
> @@ -175,8 +175,10 @@ static int msg_bind(struct usb_composite_dev *cdev)
>  		struct usb_descriptor_header *usb_desc;
>  
>  		usb_desc = usb_otg_descriptor_alloc(cdev->gadget);
> -		if (!usb_desc)
> +		if (IS_ERR(usb_desc)) {
> +			status = PTR_ERR(usb_desc);
>  			goto fail_string_ids;
> +		}
>  		usb_otg_descriptor_init(cdev->gadget, usb_desc);
>  		otg_desc[0] = usb_desc;
>  		otg_desc[1] = NULL;
Ignore this.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ