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

Skip to content
Commit ab1674e6 authored by Ajay Agarwal's avatar Ajay Agarwal
Browse files

usb: ci13xxx_udc: Set OTG's peripheral to NULL in udc_remove



If msm_otg_probe fails after registering the peripheral driver,
then we go for unregistering the gadget via udc_remove. But we
still set the OTG's peripheral as the previous gadget pointer the
elements of which have been cleared. Then when we try to start
peripheral mode, it leads to NULL pointer dereference when the
gadget ops are accessed.

Fix this by setting OTG's peripheral to NULL, thus bailing out if
we try to start peripheral mode.

Change-Id: Ib1a90ecd1342a7df57270298906b689d088f3e8a
Signed-off-by: default avatarAjay Agarwal <ajaya@codeaurora.org>
parent 8f3515e7
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