diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2016-06-23 14:54:37 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-06-24 20:03:12 -0400 |
commit | 7e8b3dfef16375dbfeb1f36a83eb9f27117c51fd (patch) | |
tree | e056432b1d7d3ce0301ae4e1b0f7b975af9d98d5 | |
parent | 1a34c4d0ae888b229b8ffd99835be254b0024f88 (diff) |
USB: EHCI: declare hostpc register as zero-length array
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: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Wilfried Klaebe <linux-kernel@lebenslange-mailadresse.de>
Tested-by: Wilfried Klaebe <linux-kernel@lebenslange-mailadresse.de>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | include/linux/usb/ehci_def.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h index 966889a20ea3..e479033bd782 100644 --- a/include/linux/usb/ehci_def.h +++ b/include/linux/usb/ehci_def.h | |||
@@ -180,11 +180,11 @@ struct ehci_regs { | |||
180 | * PORTSCx | 180 | * PORTSCx |
181 | */ | 181 | */ |
182 | /* HOSTPC: offset 0x84 */ | 182 | /* HOSTPC: offset 0x84 */ |
183 | u32 hostpc[1]; /* HOSTPC extension */ | 183 | u32 hostpc[0]; /* HOSTPC extension */ |
184 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ | 184 | #define HOSTPC_PHCD (1<<22) /* Phy clock disable */ |
185 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ | 185 | #define HOSTPC_PSPD (3<<25) /* Port speed detection */ |
186 | 186 | ||
187 | u32 reserved5[16]; | 187 | u32 reserved5[17]; |
188 | 188 | ||
189 | /* USBMODE_EX: offset 0xc8 */ | 189 | /* USBMODE_EX: offset 0xc8 */ |
190 | u32 usbmode_ex; /* USB Device mode extension */ | 190 | u32 usbmode_ex; /* USB Device mode extension */ |