From: Felipe Balbi <balbi@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>, Greg KH <greg@kroah.com>
Cc: USB mailing list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] USB: gadget: dummy-hcd: Fix errors in port-reset handling
Date: Thu, 14 Jan 2021 11:00:16 +0200 [thread overview]
Message-ID: <87h7nj3nbz.fsf@kernel.org> (raw)
In-Reply-To: <20210113194510.GA1290698@rowland.harvard.edu>
[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]
Alan Stern <stern@rowland.harvard.edu> writes:
> Commit c318840fb2a4 ("USB: Gadget: dummy-hcd: Fix shift-out-of-bounds
> bug") messed up the way dummy-hcd handles requests to turn on the
> RESET port feature (I didn't notice that the original switch case
> ended with a fallthrough). The call to set_link_state() was
> inadvertently removed, as was the code to set the USB_PORT_STAT_RESET
> flag when the speed is USB2.
>
> In addition, the original code never checked whether the port was
> connected before handling the port-reset request. There was a check
> for the port being powered, but it was removed by that commit! In
> practice this doesn't matter much because the kernel doesn't try to
> reset disconnected ports, but it's still bad form.
>
> This patch fixes these problems by changing the fallthrough to break,
> adding back in the missing set_link_state() call, setting the
> port-reset status flag, adding a port-is-connected test, and removing
> a redundant assignment statement.
>
> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> Fixes: c318840fb2a4 ("USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug")
> CC: <stable@vger.kernel.org>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
prev parent reply other threads:[~2021-01-14 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 19:45 [PATCH] USB: gadget: dummy-hcd: Fix errors in port-reset handling Alan Stern
2021-01-14 9:00 ` 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=87h7nj3nbz.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=greg@kroah.com \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.