From: Felipe Balbi <balbi@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Yang Yingliang <yangyingliang@huawei.com>,
linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: hid: fix error code in do_config()
Date: Mon, 11 Oct 2021 16:03:02 +0300 [thread overview]
Message-ID: <87lf2z3e8x.fsf@kernel.org> (raw)
In-Reply-To: <20211011123739.GC15188@kili>
Hi,
Dan Carpenter <dan.carpenter@oracle.com> writes:
> Return an error code if usb_get_function() fails. Don't return success.
>
> Fixes: 4bc8a33f2407 ("usb: gadget: hid: convert to new interface of f_hid")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/usb/gadget/legacy/hid.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/legacy/hid.c b/drivers/usb/gadget/legacy/hid.c
> index 5b27d289443f..3912cc805f3a 100644
> --- a/drivers/usb/gadget/legacy/hid.c
> +++ b/drivers/usb/gadget/legacy/hid.c
> @@ -99,8 +99,10 @@ static int do_config(struct usb_configuration *c)
>
> list_for_each_entry(e, &hidg_func_list, node) {
> e->f = usb_get_function(e->fi);
> - if (IS_ERR(e->f))
> + if (IS_ERR(e->f)) {
> + status = PTR_ERR(e->f);
nice catch! :-)
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
prev parent reply other threads:[~2021-10-11 13:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-11 12:37 [PATCH] usb: gadget: hid: fix error code in do_config() Dan Carpenter
2021-10-11 13:03 ` Felipe Balbi [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=87lf2z3e8x.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=andrzej.p@samsung.com \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=yangyingliang@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;
as well as URLs for NNTP newsgroup(s).