usb: dwc3-msm: Fix invalid usb_psy access during remove
The "qcom,usb-charger" property is optional and hence may result
in the usb_psy pointer being initialized to a negative ERR_PTR
value. This leads to invalid pointer access in dwc3_msm_remove()
when calling power_supply_put() on it. Fix this by switching to
the managed variant of devm_power_supply_get_by_phandle() which
allows us to simply remove the power_supply_put() call.
Change-Id: I4fd1e46fd410fe143b1e499da1e9cf91dd53dd66
Signed-off-by:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment