]> www.infradead.org Git - users/dwmw2/linux.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)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:32 +0000 (21:36 -0400)
commit3dc4ce39130b2ed36a97573c2bc0eb981ce39a7b
tree3c1b70e5fa297a0be4bdf37e86051671bc0d8494
parentae0db7d167ae098307f0c0c27d6a30ae90ca6940
usb: musb: gadget: misplaced out of bounds check

[ Upstream commit af6f8529098aeb0e56a68671b450cf74e7a64fcd ]

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>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/usb/musb/musb_gadget_ep0.c