mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
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: Xiaojun Sang <xsang@codeaurora.org>
This commit is contained in:
parent
06ed8063cd
commit
b588d829ad
2 changed files with 12 additions and 0 deletions
|
|
@ -732,6 +732,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__);
|
||||
|
|
|
|||
|
|
@ -1530,6 +1530,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__);
|
||||
|
|
|
|||
Loading…
Reference in a new issue