diff options
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 4b6ed353ae36..305db36a3b1c 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -1153,7 +1153,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr) | |||
1153 | | USB_REQ_GET_STATUS: | 1153 | | USB_REQ_GET_STATUS: |
1154 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; | 1154 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; |
1155 | ep = &udc->ep[tmp]; | 1155 | ep = &udc->ep[tmp]; |
1156 | if (tmp > NUM_ENDPOINTS || (tmp && !ep->desc)) | 1156 | if (tmp >= NUM_ENDPOINTS || (tmp && !ep->desc)) |
1157 | goto stall; | 1157 | goto stall; |
1158 | 1158 | ||
1159 | if (tmp) { | 1159 | if (tmp) { |
@@ -1176,7 +1176,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr) | |||
1176 | | USB_REQ_SET_FEATURE: | 1176 | | USB_REQ_SET_FEATURE: |
1177 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; | 1177 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; |
1178 | ep = &udc->ep[tmp]; | 1178 | ep = &udc->ep[tmp]; |
1179 | if (w_value != USB_ENDPOINT_HALT || tmp > NUM_ENDPOINTS) | 1179 | if (w_value != USB_ENDPOINT_HALT || tmp >= NUM_ENDPOINTS) |
1180 | goto stall; | 1180 | goto stall; |
1181 | if (!ep->desc || ep->is_iso) | 1181 | if (!ep->desc || ep->is_iso) |
1182 | goto stall; | 1182 | goto stall; |
@@ -1195,7 +1195,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr) | |||
1195 | | USB_REQ_CLEAR_FEATURE: | 1195 | | USB_REQ_CLEAR_FEATURE: |
1196 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; | 1196 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; |
1197 | ep = &udc->ep[tmp]; | 1197 | ep = &udc->ep[tmp]; |
1198 | if (w_value != USB_ENDPOINT_HALT || tmp > NUM_ENDPOINTS) | 1198 | if (w_value != USB_ENDPOINT_HALT || tmp >= NUM_ENDPOINTS) |
1199 | goto stall; | 1199 | goto stall; |
1200 | if (tmp == 0) | 1200 | if (tmp == 0) |
1201 | goto succeed; | 1201 | goto succeed; |