Commit 504b13fb authored by Albert Wang's avatar Albert Wang Committed by Todd Kjos
Browse files

UPSTREAM: usb: dwc3: gadget: Fix null pointer exception



[ Upstream commit 26288448 ]

In the endpoint interrupt functions
dwc3_gadget_endpoint_transfer_in_progress() and
dwc3_gadget_endpoint_trbs_complete() will dereference the endpoint
descriptor. But it could be cleared in __dwc3_gadget_ep_disable()
when accessory disconnected. So we need to check whether it is null
or not before dereferencing it.

Bug: 202829886
Bug: 204052921
Fixes: f09ddcfc ("usb: dwc3: gadget: Prevent EP queuing while stopping transfers")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: default avatarJack Pham <quic_jackp@quicinc.com>
Signed-off-by: default avatarAlbert Wang <albertccwang@google.com>
Link: https://lore.kernel.org/r/20211109092642.3507692-1-albertccwang@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I767f61f3c8840b7854a467ab6bf18c26c89757c2
Signed-off-by: default avatarAlbert Wang <albertccwang@google.com>
parent 143ac631
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment