Explorar o código

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 %!s(int64=13) %!d(string=hai) anos
pai
achega
66bb2a7f83
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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);