From: chenzhou <chenzhou10@huawei.com>
To: <balbi@kernel.org>
Cc: <gregkh@linuxfoundation.org>, <weiyongjun1@huawei.com>,
<jun.li@freescale.com>, <rogerq@ti.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH] usb: gadget: mass_storage: fix error return code in msg_bind()
Date: Thu, 12 Nov 2020 21:23:04 +0800 [thread overview]
Message-ID: <53ee397a-ef2e-4248-8d32-52c8d1e138e9@huawei.com> (raw)
In-Reply-To: <20201112085324.181903-1-chenzhou10@huawei.com>
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@huawei.com>
> Signed-off-by: Chen Zhou <chenzhou10@huawei.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.
prev parent reply other threads:[~2020-11-12 13:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 8:53 Chen Zhou
2020-11-12 13:23 ` chenzhou [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53ee397a-ef2e-4248-8d32-52c8d1e138e9@huawei.com \
--to=chenzhou10@huawei.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hulkci@huawei.com \
--cc=jun.li@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rogerq@ti.com \
--cc=weiyongjun1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®