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)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Aug 2016 21:22:34 +0000 (23:22 +0200)
commit122ac0bd1d6385759bd8a8b052f5b4e3afba82af
tree7f018517737d05903506f7ae409d499a8c27a3d1
parent903c5a46a861244e7fc5ddf6101963b6a4c9b88f
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>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/linux/usb/ehci_def.h