Commit 00af9bac authored by Dan Carpenter's avatar Dan Carpenter Committed by Ben Hutchings

usb: gadget: fsl_qe_udc: off by one in setup_received_handle()

commit 7442e6db upstream.

The udc->eps[] array has USB_MAX_ENDPOINTS elements so > should be >=.

Fixes: 3948f0e0 ('usb: add Freescale QE/CPM USB peripheral controller driver')
Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
[bwh: Backported to 3.16: adjust filename]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent bb8101e8
......@@ -2057,7 +2057,7 @@ static void setup_received_handle(struct qe_udc *udc,
struct qe_ep *ep;
if (wValue != 0 || wLength != 0
|| pipe > USB_MAX_ENDPOINTS)
|| pipe >= USB_MAX_ENDPOINTS)
break;
ep = &udc->eps[pipe];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment