Explorar el Código

Merge "asoc: codecs: add null pointer check for swr control data"

Linux Build Service Account hace 7 años
padre
commit
3cf90f9a08
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      asoc/codecs/wcd934x/wcd934x.c

+ 5 - 0
asoc/codecs/wcd934x/wcd934x.c

@@ -2957,6 +2957,11 @@ static int __tavil_codec_enable_swr(struct snd_soc_dapm_widget *w, int event)
 
 	tavil = snd_soc_codec_get_drvdata(codec);
 
+	if (!tavil->swr.ctrl_data)
+		return -EINVAL;
+	if (!tavil->swr.ctrl_data[0].swr_pdev)
+		return -EINVAL;
+
 	switch (event) {
 	case SND_SOC_DAPM_PRE_PMU:
 		if (((strnstr(w->name, "INT7_", sizeof("RX INT7_"))) ||