Commit 2ace47be authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Mark Brown

ASoC: wm0010: fix memory leak

We have requested for the firmware but we have missed releasing it both
on success and on error path.
While checking the code it turned out that the requested firmware is not
even used. More over the same firmware is being loaded by
wm0010_stage2_load().
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 51d2eeef
...@@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) ...@@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec); struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec);
unsigned long flags; unsigned long flags;
int ret; int ret;
const struct firmware *fw;
struct spi_message m; struct spi_message m;
struct spi_transfer t; struct spi_transfer t;
struct dfw_pllrec pll_rec; struct dfw_pllrec pll_rec;
...@@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec) ...@@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
wm0010->state = WM0010_OUT_OF_RESET; wm0010->state = WM0010_OUT_OF_RESET;
spin_unlock_irqrestore(&wm0010->irq_lock, flags); spin_unlock_irqrestore(&wm0010->irq_lock, flags);
/* First the bootloader */
ret = request_firmware(&fw, "wm0010_stage2.bin", codec->dev);
if (ret != 0) {
dev_err(codec->dev, "Failed to request stage2 loader: %d\n",
ret);
goto abort;
}
if (!wait_for_completion_timeout(&wm0010->boot_completion, if (!wait_for_completion_timeout(&wm0010->boot_completion,
msecs_to_jiffies(20))) msecs_to_jiffies(20)))
dev_err(codec->dev, "Failed to get interrupt from DSP\n"); dev_err(codec->dev, "Failed to get interrupt from DSP\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment