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>
This commit is contained in:
Fabio Estevam 2012-04-05 10:57:51 -03:00 committed by Mark Brown
parent 00792ac4e0
commit 66bb2a7f83
1 changed files with 3 additions and 0 deletions

View File

@ -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);