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

Commit 94cd6c19 authored by Vijayavardhan Vennapusa's avatar Vijayavardhan Vennapusa
Browse files

USB: u_data_ipa: Fix pm_runtime usage count in case of error



If disconnect happens before connect_work start executing, then
there is a chance that connect_work returns with port_usb NULL.
Due to this, port->is_connected will be NULL and disconnect_work
returns with this check, but not decremented pm_usage count, which
is incremented before scheduling connect_work in ipa_data_connect.
Hence fix this by decrementing pm_usage count in connect_work if
port_usb is NULL.

Change-Id: Ic60f2addcf07375429e0858d3c7a376a35132750
Signed-off-by: default avatarVijayavardhan Vennapusa <vvreddy@codeaurora.org>
parent 110e102f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -402,6 +402,7 @@ static void ipa_data_connect_work(struct work_struct *w)

	if (!port->port_usb) {
		spin_unlock_irqrestore(&port->port_lock, flags);
		usb_gadget_autopm_put_async(port->gadget);
		pr_err("%s(): port_usb is NULL.\n", __func__);
		return;
	}