[alsa-devel] [PATCH] ASoC: imx-audmux: remove null check of audmux_base in audmux_read_file
When audmux_read_file is called, it means the driver is already initialised successfully, so we don't need to check audmux_base.
It also fix smatch warning: sound/soc/fsl/imx-audmux.c:78 audmux_read_file() warn: possible memory leak of 'buf'
Signed-off-by: Richard Zhao richard.zhao@freescale.com --- sound/soc/fsl/imx-audmux.c | 3 --- 1 file changed, 3 deletions(-)
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c index e7c800e..524ce62 100644 --- a/sound/soc/fsl/imx-audmux.c +++ b/sound/soc/fsl/imx-audmux.c @@ -74,9 +74,6 @@ 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);
On Tue, Sep 18, 2012 at 04:38:30PM +0800, Richard Zhao wrote:
When audmux_read_file is called, it means the driver is already initialised successfully, so we don't need to check audmux_base.
It also fix smatch warning: sound/soc/fsl/imx-audmux.c:78 audmux_read_file() warn: possible memory leak of 'buf'
Applied, though it doesn't seem like the best fix to remove an error check even if it should be redundant.
participants (2)
-
Mark Brown
-
Richard Zhao