Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7442e6db authored by Dan Carpenter's avatar Dan Carpenter Committed by Felipe Balbi
Browse files

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



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>
parent 327b21da
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2053,7 +2053,7 @@ static void setup_received_handle(struct qe_udc *udc,
			struct qe_ep *ep;
			struct qe_ep *ep;


			if (wValue != 0 || wLength != 0
			if (wValue != 0 || wLength != 0
				|| pipe > USB_MAX_ENDPOINTS)
				|| pipe >= USB_MAX_ENDPOINTS)
				break;
				break;
			ep = &udc->eps[pipe];
			ep = &udc->eps[pipe];