mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
usb: host: max3421: Reject hub port requests for non-existent ports
[ Upstream commit11b5c101e2] The `max3421_hub_control()` function handles USB hub class requests to the virtual root hub. The `GetPortStatus` case correctly rejects requests with `index != 1`, since the virtual root hub has only a single port. However, the `ClearPortFeature` and `SetPortFeature` cases lack the same check. Fix this by extending the `index != 1` rejection to both cases, matching the existing behavior of `GetPortStatus`. Fixes:2d53139f31("Add support for using a MAX3421E chip as a host driver.") Suggested-by: Alan Stern <stern@rowland.harvard.edu> Reviewed-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Seungjin Bae <eeodqql09@gmail.com> Link: https://patch.msgid.link/20260518224901.1887013-3-eeodqql09@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d512bdefd2
commit
2bb0cfa139
@@ -1685,6 +1685,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
|
||||
case ClearHubFeature:
|
||||
break;
|
||||
case ClearPortFeature:
|
||||
if (index != 1)
|
||||
goto error;
|
||||
switch (value) {
|
||||
case USB_PORT_FEAT_SUSPEND:
|
||||
break;
|
||||
@@ -1728,6 +1730,8 @@ max3421_hub_control(struct usb_hcd *hcd, u16 type_req, u16 value, u16 index,
|
||||
break;
|
||||
|
||||
case SetPortFeature:
|
||||
if (index != 1)
|
||||
goto error;
|
||||
switch (value) {
|
||||
case USB_PORT_FEAT_LINK_STATE:
|
||||
case USB_PORT_FEAT_U1_TIMEOUT:
|
||||
|
||||
Reference in New Issue
Block a user