]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
usb: musb: gadget: misplaced out of bounds check
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 29 Mar 2018 15:48:28 +0000 (10:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Mar 2018 16:37:28 +0000 (18:37 +0200)
commitaf6f8529098aeb0e56a68671b450cf74e7a64fcd
treed42d1e620633a05b2c697add92360b54c6317641
parentbe9cae2479f48d18f7a449ba91677ae97df11f3e
usb: musb: gadget: misplaced out of bounds check

musb->endpoints[] has array size MUSB_C_NUM_EPS.
We must check array bounds before accessing the array and not afterwards.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Bin Liu <b-liu@ti.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/musb_gadget_ep0.c