Skip to content
Commit d223be4a authored by Mayank Rana's avatar Mayank Rana
Browse files

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: default avatarMayank Rana <mrana@codeaurora.org>
parent 7529b53b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment