浏览代码

ASoC: imx-audmux: Check for NULL pointer

Check for NULL pointer before accessing it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Fabio Estevam 13 年之前
父节点
当前提交
66bb2a7f83
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      sound/soc/imx/imx-audmux.c

+ 3 - 0
sound/soc/imx/imx-audmux.c

@@ -79,6 +79,9 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
 	if (!buf)
 		return -ENOMEM;
 
+	if (!audmux_base)
+		return -ENOSYS;
+
 	if (audmux_clk)
 		clk_prepare_enable(audmux_clk);