dwc3: gadget: Add NULL check against endpoint desc
dwc3_ep0_inspect_setup() API inspects received setup packet, and USB
function driver or composite driver tries to provide response to host
using ep0 endpoint. This shall fail if ep0 is already being disabled.
With this failure case, dwc3_ep0_inspect_setup() tries to clear ep0
endpoint halt. This result into NULL pointer crash if ep0 is already
disabled. Hence check ep0 endpoint descriptor against NULL with
__dwc3_gadget_ep_set_halt() API.
Also don't try to halt ep0 endpoint if setup packet's response queueing
is failed on ep0 by checking ret value against -ESHUTDOWN.
CRs-Fixed: 2057291
Change-Id: I7d3b8e46afb845c1b6cdf76e5d0d6b793ba6c854
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Loading
Please register or sign in to comment