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

Commit 9393565b authored by Jeff Hugo's avatar Jeff Hugo Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: bam_dmux: Do not perform close() on non-open channels



Performing a close operation on a channel that isn't opened may corrupt
internal state under some situations such as SSR.  Validate the channel
before allowing a close operation on it.

Change-Id: Ia8632163636e6ed08b2f68b98ba19d61c8a449fa
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent 12a3f694
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1158,7 +1158,7 @@ int msm_bam_dmux_close(uint32_t id)
	if (id >= BAM_DMUX_NUM_CHANNELS)
		return -EINVAL;
	DBG("%s: closing ch %d\n", __func__, id);
	if (!bam_mux_initialized)
	if (!bam_mux_initialized || !bam_ch_is_local_open(id))
		return -ENODEV;

	read_lock(&ul_wakeup_lock);