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

Commit 85bdc3ec authored by Saket Saurabh's avatar Saket Saurabh
Browse files

usb: phy-msm-usb: Return when usb power supply psy is NULL



If usb power supply is not registered, psy would be NULL.
In msm_otg_set_online_status(), add return code when psy is
NULL to prevent NULL pointer dereference.

Change-Id: I03ddfe79c6bddd4eb1a5e5f5bf489c5f5e6baa65
Signed-off-by: default avatarSaket Saurabh <ssaurabh@codeaurora.org>
parent 763e35c9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1442,8 +1442,10 @@ psy_error:

static void msm_otg_set_online_status(struct msm_otg *motg)
{
	if (!psy)
	if (!psy) {
		dev_dbg(motg->phy.dev, "no usb power supply registered\n");
		return;
	}

	/* Set power supply online status to false */
	if (power_supply_set_online(psy, false))