diff options
Diffstat (limited to 'sound/soc/fsl/imx-audmux.c')
-rw-r--r-- | sound/soc/fsl/imx-audmux.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c index d3bf71a0ec56..ac869931d7f1 100644 --- a/sound/soc/fsl/imx-audmux.c +++ b/sound/soc/fsl/imx-audmux.c | |||
@@ -66,13 +66,10 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf, | |||
66 | size_t count, loff_t *ppos) | 66 | size_t count, loff_t *ppos) |
67 | { | 67 | { |
68 | ssize_t ret; | 68 | ssize_t ret; |
69 | char *buf = kmalloc(PAGE_SIZE, GFP_KERNEL); | 69 | char *buf; |
70 | int port = (int)file->private_data; | 70 | int port = (int)file->private_data; |
71 | u32 pdcr, ptcr; | 71 | u32 pdcr, ptcr; |
72 | 72 | ||
73 | if (!buf) | ||
74 | return -ENOMEM; | ||
75 | |||
76 | if (audmux_clk) { | 73 | if (audmux_clk) { |
77 | ret = clk_prepare_enable(audmux_clk); | 74 | ret = clk_prepare_enable(audmux_clk); |
78 | if (ret) | 75 | if (ret) |
@@ -85,6 +82,10 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf, | |||
85 | if (audmux_clk) | 82 | if (audmux_clk) |
86 | clk_disable_unprepare(audmux_clk); | 83 | clk_disable_unprepare(audmux_clk); |
87 | 84 | ||
85 | buf = kmalloc(PAGE_SIZE, GFP_KERNEL); | ||
86 | if (!buf) | ||
87 | return -ENOMEM; | ||
88 | |||
88 | ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", | 89 | ret = snprintf(buf, PAGE_SIZE, "PDCR: %08x\nPTCR: %08x\n", |
89 | pdcr, ptcr); | 90 | pdcr, ptcr); |
90 | 91 | ||