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

Commit a5d6b7b2 authored by Amir Levy's avatar Amir Levy
Browse files

msm: ipa3: fix setting USB state to invalid before count is 0



ipa3_usb_deinit_teth_prot should set USB state to invalid only if there
are no initialized protocols.
The set state operation is now performed only after verifying that the
initialized protocols number has reached zero.

Change-Id: Id61ac28ef34a03542f175efa5326cd014d37f9f4
Signed-off-by: default avatarAmir Levy <alevy@codeaurora.org>
parent a660e4d0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2173,10 +2173,10 @@ int ipa3_usb_deinit_teth_prot(enum ipa_usb_teth_prot teth_prot)
		goto bad_params;
	}

	if (!ipa3_usb_set_state(IPA_USB_INVALID, false, ttype))
			IPA_USB_ERR("failed to change state to invalid\n");
	if (IPA3_USB_IS_TTYPE_DPL(ttype) ||
		(ipa3_usb_ctx->num_init_prot == 0)) {
		if (!ipa3_usb_set_state(IPA_USB_INVALID, false, ttype))
			IPA_USB_ERR("failed to change state to invalid\n");
		ipa_rm_delete_resource(
			ipa3_usb_ctx->ttype_ctx[ttype].rm_ctx.prod_params.name);
		ipa3_usb_ctx->ttype_ctx[ttype].rm_ctx.prod_valid = false;