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

Commit 4d166ac6 authored by Manikanta Pubbisetty's avatar Manikanta Pubbisetty Committed by Yeshwanth Sriram Guntuka
Browse files

qcacmn: fix runtime PM get/put out of sync

Currently, in get_htc_send_packets() when the
hif_system_pm_state_check() fails, we are not doing a
runtime PM put operation for the corresponding get operation.
This imbalance will never make the system enter runtime suspend
state and also we do a BUG() when such imbalance is encountered
during runtime PM deinit. This change also fixes a potential
memory leak.

Change-Id: I3e5916005d583de42a49dd2dc0632bfcca1251e4
CRs-Fixed: 2947247
parent 1cc9b324
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1306,16 +1306,19 @@ static void get_htc_send_packets(HTC_TARGET *target,
			}
		}

		pPacket = htc_packet_dequeue(tx_queue);
		if (!pPacket) {
		ret = hif_system_pm_state_check(target->hif_dev);
		if (ret) {
			if (do_pm_get)
				hif_pm_runtime_put(target->hif_dev, rtpm_dbgid);
			break;
		}

		ret = hif_system_pm_state_check(target->hif_dev);
		if (ret)
		pPacket = htc_packet_dequeue(tx_queue);
		if (!pPacket) {
			if (do_pm_get)
				hif_pm_runtime_put(target->hif_dev, rtpm_dbgid);
			break;
		}

		AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
				(" Got packet:%pK , New Queue Depth: %d\n",