]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
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)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 9 Aug 2016 13:07:53 +0000 (15:07 +0200)
commite666564946c8606ad4ff2e0ad06edcc73cf953d6
tree29661e67f260001a9c86fb265b544072eb33b812
parente5040e46a72cc2a6ac391ed6502814c1c09e332c
USB: EHCI: declare hostpc register as zero-length array

BugLink: http://bugs.launchpad.net/bugs/1607404
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
include/linux/usb/ehci_def.h