|
@@ -89,15 +89,19 @@ static int service_tx_status_request(
|
|
}
|
|
}
|
|
|
|
|
|
is_in = epnum & USB_DIR_IN;
|
|
is_in = epnum & USB_DIR_IN;
|
|
- if (is_in) {
|
|
|
|
- epnum &= 0x0f;
|
|
|
|
|
|
+ epnum &= 0x0f;
|
|
|
|
+ if (epnum >= MUSB_C_NUM_EPS) {
|
|
|
|
+ handled = -EINVAL;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (is_in)
|
|
ep = &musb->endpoints[epnum].ep_in;
|
|
ep = &musb->endpoints[epnum].ep_in;
|
|
- } else {
|
|
|
|
|
|
+ else
|
|
ep = &musb->endpoints[epnum].ep_out;
|
|
ep = &musb->endpoints[epnum].ep_out;
|
|
- }
|
|
|
|
regs = musb->endpoints[epnum].regs;
|
|
regs = musb->endpoints[epnum].regs;
|
|
|
|
|
|
- if (epnum >= MUSB_C_NUM_EPS || !ep->desc) {
|
|
|
|
|
|
+ if (!ep->desc) {
|
|
handled = -EINVAL;
|
|
handled = -EINVAL;
|
|
break;
|
|
break;
|
|
}
|
|
}
|