Commit 122ac0bd authored by Alan Stern's avatar Alan Stern Committed by Willy Tarreau

USB: EHCI: declare hostpc register as zero-length array

commit 7e8b3dfe upstream.

The HOSTPC extension registers found in some EHCI implementations form
a variable-length array, with one element for each port.  Therefore
the hostpc field in struct ehci_regs should be declared as a
zero-length array, not a single-element array.

This fixes a problem reported by UBSAN.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Reported-by: default avatarWilfried Klaebe <linux-kernel@lebenslange-mailadresse.de>
Tested-by: default avatarWilfried Klaebe <linux-kernel@lebenslange-mailadresse.de>
CC: <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
parent 903c5a46
...@@ -178,11 +178,11 @@ struct ehci_regs { ...@@ -178,11 +178,11 @@ struct ehci_regs {
* PORTSCx * PORTSCx
*/ */
/* HOSTPC: offset 0x84 */ /* HOSTPC: offset 0x84 */
u32 hostpc[1]; /* HOSTPC extension */ u32 hostpc[0]; /* HOSTPC extension */
#define HOSTPC_PHCD (1<<22) /* Phy clock disable */ #define HOSTPC_PHCD (1<<22) /* Phy clock disable */
#define HOSTPC_PSPD (3<<25) /* Port speed detection */ #define HOSTPC_PSPD (3<<25) /* Port speed detection */
u32 reserved5[16]; u32 reserved5[17];
/* USBMODE_EX: offset 0xc8 */ /* USBMODE_EX: offset 0xc8 */
u32 usbmode_ex; /* USB Device mode extension */ u32 usbmode_ex; /* USB Device mode extension */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment