summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/imx-audmux.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/fsl/imx-audmux.c')
-rw-r--r--sound/soc/fsl/imx-audmux.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index ac86993..d3bf71a 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -66,10 +66,13 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
ssize_t ret;
- char *buf;
+ char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
int port = (int)file->private_data;
u32 pdcr, ptcr;
+ if (!buf)
+ return -ENOMEM;
+
if (audmux_clk) {
ret = clk_prepare_enable(audmux_clk);
if (ret)
@@ -82,10 +85,6 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,
if (audmux_clk)
clk_disable_unprepare(audmux_clk);
- buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
- if (!buf)
- return -ENOMEM;
-
ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n",
pdcr, ptcr);