Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit a65b3171 authored by Manu Gautam's avatar Manu Gautam Committed by Stephen Boyd
Browse files

usb: dwc3: gadget: Acquire spin_lock before checking usb_ep->desc



usb_ep's desc field is marked as NULL in ep_disable which gets
called on cable disconnect. Currently, ep_queue function is
checking for ep->desc before acquiring spin_lock. If USB cable
gets disconnected after ep->desc check but before spin_lock is
acquired then there are chances of hitting NULL pointer
dereference subsequently when ep_queue function later tries to
access ep->desc. Fix this by acquiring spin_lock before ep->desc
check in ep_queue.

CRs-Fixed: 454236
Change-Id: Icd7c2cf5ea3583759143555521ce44403f20e2bd
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 033c0bcd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment