[alsa-devel] [PATCH] ASoC: wm_adsp: Release firmware on memory allocation failure

Dimitris Papastamos dp at opensource.wolfsonmicro.com
Wed Oct 30 18:03:44 CET 2013


Signed-off-by: Dimitris Papastamos <dp at opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index b3fbe4a..a2144b0 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -630,7 +630,8 @@ static int wm_adsp_load(struct wm_adsp *dsp)
 				      GFP_KERNEL | GFP_DMA);
 			if (!buf) {
 				adsp_err(dsp, "Out of memory\n");
-				return -ENOMEM;
+				ret = -ENOMEM;
+				goto out_fw;
 			}
 
 			ret = regmap_raw_write(regmap, reg, buf,
-- 
1.8.4.2



More information about the Alsa-devel mailing list