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

Commit 6da283a5 authored by xsang's avatar xsang Committed by Gerrit - the friendly Code Review server
Browse files

asoc: add null check for pcm pointer of snd_pcm_volume



In platform driver volume controls, add null check for
pcm pointer of struct snd_pcm_volume.

Change-Id: I511a79422eaeced6240849cbb665a289afdc5984
Signed-off-by: default avatarXiaojun Sang <xsang@codeaurora.org>
parent a033f8c9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -730,6 +730,12 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
		pr_err("%s: vol is NULL\n", __func__);
		return -ENODEV;
	}

	if (!vol->pcm) {
		pr_err("%s: vol->pcm is NULL\n", __func__);
		return -ENODEV;
	}

	substream = vol->pcm->streams[vol->stream].substream;
	if (!substream) {
		pr_err("%s substream not found\n", __func__);
+6 −0
Original line number Diff line number Diff line
@@ -1534,6 +1534,12 @@ static int msm_pcm_volume_ctl_get(struct snd_kcontrol *kcontrol,
		pr_err("%s: vol is NULL\n", __func__);
		return -ENODEV;
	}

	if (!vol->pcm) {
		pr_err("%s: vol->pcm is NULL\n", __func__);
		return -ENODEV;
	}

	substream = vol->pcm->streams[vol->stream].substream;
	if (!substream) {
		pr_err("%s substream not found\n", __func__);