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

Commit 8ddf0544 authored by Laxminath Kasam's avatar Laxminath Kasam Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: lsm-client: Fix null pointer access when no LSM session



When no LSM session is active, return from msm_lsm_close
and avoid null pointer dereference.

Change-Id: I9f57c08e080497765eaefef0c031bbf956c02914
Signed-off-by: default avatarLaxminath Kasam <lkasam@codeaurora.org>
parent c0a21ff3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1724,6 +1724,10 @@ static int msm_lsm_close(struct snd_pcm_substream *substream)
		pr_err("%s: Invalid private_data", __func__);
		return -EINVAL;
	}
	if (!prtd || !prtd->lsm_client) {
		pr_err("%s: No LSM session active\n", __func__);
		return -EINVAL;
	}
	rtd = substream->private_data;

	dev_dbg(rtd->dev, "%s\n", __func__);