瀏覽代碼

Merge "asoc: codecs: add null check before access"

qctecmdr 6 年之前
父節點
當前提交
0d9b09f760
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      asoc/codecs/wcd938x/wcd938x.c

+ 7 - 0
asoc/codecs/wcd938x/wcd938x.c

@@ -1355,6 +1355,13 @@ int wcd938x_micbias_control(struct snd_soc_component *component,
 			__func__, micb_index);
 		return -EINVAL;
 	}
+
+	if (NULL == wcd938x) {
+		dev_err(component->dev,
+			"%s: wcd938x private data is NULL\n", __func__);
+		return -EINVAL;
+	}
+
 	switch (micb_num) {
 	case MIC_BIAS_1:
 		micb_reg = WCD938X_ANA_MICB1;