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

Commit f85c9652 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: dwc3: Add a NULL check in dwc3_resume_work()



If extcon property is not present dwc3_resume_work()
dereferences extcon notifier block pointer to get the
extcon device. This results into NULL pointer
dereference. Add NULL check for extcon to skip extcon
related handling.

Change-Id: I0581cf13a6f577ebaf28817c6afe5839b08b2e95
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent eb182d17
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2513,10 +2513,10 @@ static void dwc3_resume_work(struct work_struct *w)

	dev_dbg(mdwc->dev, "%s: dwc3 resume work\n", __func__);

	if (mdwc->vbus_active && !mdwc->in_restart) {
	if (mdwc->extcon && mdwc->vbus_active && !mdwc->in_restart) {
		extcon_id = EXTCON_USB;
		edev = mdwc->extcon[mdwc->ext_idx].edev;
	} else if (mdwc->id_state == DWC3_ID_GROUND) {
	} else if (mdwc->extcon && mdwc->id_state == DWC3_ID_GROUND) {
		extcon_id = EXTCON_USB_HOST;
		edev = mdwc->extcon[mdwc->ext_idx].edev;
	}