usb: dwc3: gadget: Iterate only over valid endpoints
authorJack Pham <jackp@codeaurora.org>
Wed, 26 Mar 2014 17:31:44 +0000 (10:31 -0700)
committerFelipe Balbi <balbi@ti.com>
Wed, 16 Apr 2014 15:11:45 +0000 (10:11 -0500)
commit32702e96a9f76ea0e0a1d218310d2ac1adbd2907
tree46d152d4f7e1f9bb96020e1f8b9e909f81f56cb3
parent8b2bc2c9351b4c09bc3d9096e2a7af3988565dbf
usb: dwc3: gadget: Iterate only over valid endpoints

Make dwc3_gadget_resize_tx_fifos() iterate only over IN
endpoints that are actually present, based on the
num_in_eps parameter. This terminates the loop so as to
prevent dereferencing a potential NULL dwc->eps[i] where
i >= (num_in_eps + num_out_eps).

Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c