Merge "msm_common.c: fix dereference of pointer 'kctl_pdata' before NULL check"

这个提交包含在:
qctecmdr
2021-04-14 00:13:12 -07:00
提交者 Gerrit - the friendly Code Review server
当前提交 d7a73f35b7

查看文件

@@ -373,8 +373,8 @@ int msm_channel_map_get(struct snd_kcontrol *kcontrol,
{ {
struct chmap_pdata *kctl_pdata = struct chmap_pdata *kctl_pdata =
(struct chmap_pdata *)kcontrol->private_data; (struct chmap_pdata *)kcontrol->private_data;
struct snd_soc_dai *codec_dai = kctl_pdata->dai; struct snd_soc_dai *codec_dai = NULL;
int backend_id = kctl_pdata->id; int backend_id = 0;
uint32_t rx_ch[MAX_PORT], tx_ch[MAX_PORT]; uint32_t rx_ch[MAX_PORT], tx_ch[MAX_PORT];
uint32_t rx_ch_cnt = 0, tx_ch_cnt = 0; uint32_t rx_ch_cnt = 0, tx_ch_cnt = 0;
uint32_t *chmap_data = NULL; uint32_t *chmap_data = NULL;
@@ -385,6 +385,9 @@ int msm_channel_map_get(struct snd_kcontrol *kcontrol,
return -EINVAL; return -EINVAL;
} }
codec_dai = kctl_pdata->dai;
backend_id = kctl_pdata->id;
ret = snd_soc_dai_get_channel_map(codec_dai, ret = snd_soc_dai_get_channel_map(codec_dai,
&tx_ch_cnt, tx_ch, &rx_ch_cnt, rx_ch); &tx_ch_cnt, tx_ch, &rx_ch_cnt, rx_ch);
if (ret || (tx_ch_cnt == 0 && rx_ch_cnt == 0)) { if (ret || (tx_ch_cnt == 0 && rx_ch_cnt == 0)) {