USB: EHCI: declare hostpc register as zero-length array
authorAlan Stern <stern@rowland.harvard.edu>
Thu, 23 Jun 2016 18:54:37 +0000 (14:54 -0400)
committerJiri Slaby <jslaby@suse.cz>
Thu, 21 Jul 2016 06:35:59 +0000 (08:35 +0200)
commit6fcbf62da1b054958dffbf039fe42c0743072ceb
treea7e2b7e05059566b7d350d3e4f170cfa7e06ec17
parent35dad94d8cf0d7b5f375813918316900e03f00c5
USB: EHCI: declare hostpc register as zero-length array

commit 7e8b3dfef16375dbfeb1f36a83eb9f27117c51fd 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: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Wilfried Klaebe <linux-kernel@lebenslange-mailadresse.de>
Tested-by: Wilfried Klaebe <linux-kernel@lebenslange-mailadresse.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
include/linux/usb/ehci_def.h