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

Commit 8a366c62 authored by Cong Tang's avatar Cong Tang Committed by Gerrit - the friendly Code Review server
Browse files

ASoc: msm: Add pm_qos_request_active condition check



Add pm_qos_request_active() status check before pm_qos_remove_request()
to avoid illegal remove behavior.

CRs-Fixed: 2069618
Change-Id: I45cf767fa5f0c51773c0dc67e03da81eb723d34f
Signed-off-by: default avatarCong Tang <congt@codeaurora.org>
parent 977b2f70
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -654,7 +654,9 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
	if (substream->ops->hw_free)
		result = substream->ops->hw_free(substream);
	snd_pcm_set_state(substream, SNDRV_PCM_STATE_OPEN);
	if (pm_qos_request_active(&substream->latency_pm_qos_req))
		pm_qos_remove_request(&substream->latency_pm_qos_req);

	return result;
}

+4 −2
Original line number Diff line number Diff line
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2014, 2017 The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -25,7 +25,9 @@ static int msm_pcm_hostless_prepare(struct snd_pcm_substream *substream)
		pr_err("%s: invalid params\n", __func__);
		return -EINVAL;
	}
	if (pm_qos_request_active(&substream->latency_pm_qos_req))
		pm_qos_remove_request(&substream->latency_pm_qos_req);

	return 0;
}