Skip to content
Snippets Groups Projects
Commit d7da214b authored by Devin Kim's avatar Devin Kim Committed by Iliyan Malchev
Browse files

usb: dwc3: gadget: Protect against ep disabling during completion

In dwc3_cleanup_done_reqs(), a potential race condition
could arise when dwc3_gadget_giveback() temporarily
releases the main spinlock.  If during this window the
very endpoint being handled becomes disabled, it would
lead to a NULL pointer dereference in the code that
follows.  Guard against this by making sure the endpoint
is still enabled after returning from the giveback call.

cherry-picked from:
https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/commit/drivers/usb/dwc3/gadget.c?h=msm-3.10&id=b7ed96c4fc37351d77af87c792cd5d11ceb1e6e4



Change-Id: Idb7651c57db3273623cf664153e7cbaf0bf9dd9d
CRs-fixed: 628972
Bug: 18541764
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
Signed-off-by: default avatarDevin Kim <dojip.kim@lge.com>
parent efe8261b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment