mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
ASoC: msm-compress: Add NULL check in msm_compr_set_volume
Add NULL check for pdata structure in msm_compr_set_volume to avoid dereference. Change-Id: I364bf95ce7df0f5b4cea0e7bd4c5926c1966aac1 Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
This commit is contained in:
parent
d155d7f509
commit
424a92ebb9
1 changed files with 4 additions and 0 deletions
|
|
@ -381,12 +381,16 @@ static int msm_compr_set_volume(struct snd_compr_stream *cstream,
|
|||
}
|
||||
|
||||
pdata = snd_soc_component_get_drvdata(component);
|
||||
if (!pdata)
|
||||
return -EINVAL;
|
||||
|
||||
if (prtd->compr_passthr != LEGACY_PCM) {
|
||||
pr_debug("%s: No volume config for passthrough %d\n",
|
||||
__func__, prtd->compr_passthr);
|
||||
return rc;
|
||||
}
|
||||
if (!rtd->dai_link || !pdata->ch_map[rtd->dai_link->id])
|
||||
return -EINVAL;
|
||||
|
||||
use_default = !(pdata->ch_map[rtd->dai_link->id]->set_ch_map);
|
||||
chmap = pdata->ch_map[rtd->dai_link->id]->channel_map;
|
||||
|
|
|
|||
Loading…
Reference in a new issue