Skip to content

Commit 1530f6f

Browse files
atmgndgregkh
authored andcommitted
usb: missing parentheses in USE_NEW_SCHEME
According to bd0e6c9 ("usb: hub: try old enumeration scheme first for high speed devices") the kernel will try the old enumeration scheme first for high speed devices. This can happen when a high speed device is plugged in. But due to missing parentheses in the USE_NEW_SCHEME define, this logic can get messed up and the incorrect result happens. Acked-by: Alan Stern <[email protected]> Signed-off-by: Qi Zhou <[email protected]> Link: https://lore.kernel.org/r/ht4mtag8ZP-HKEhD0KkJhcFnVlOFV8N8eNjJVRD9pDkkLUNhmEo8_cL_sl7xy9mdajdH-T8J3TFQsjvoYQT61NFjQXy469Ed_BbBw_x4S1E=@protonmail.com [ fixup changelog text - gregkh] Cc: stable <[email protected]> Fixes: bd0e6c9 ("usb: hub: try old enumeration scheme first for high speed devices") Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ba9b408 commit 1530f6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/core/hub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2692,7 +2692,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
26922692
#define SET_ADDRESS_TRIES 2
26932693
#define GET_DESCRIPTOR_TRIES 2
26942694
#define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
2695-
#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)scheme)
2695+
#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
26962696

26972697
#define HUB_ROOT_RESET_TIME 60 /* times are in msec */
26982698
#define HUB_SHORT_RESET_TIME 10

0 commit comments

Comments
 (0)