Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1539227 > unrolled thread

[PATCH] ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path

Started byRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
First post2016-12-09 11:00 +0100
Last post2016-12-09 11:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path Richard Fitzgerald <rf@opensource.wolfsonmicro.com> - 2016-12-09 11:00 +0100

#1539227 — [PATCH] ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path

FromRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
Date2016-12-09 11:00 +0100
Subject[PATCH] ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path
Message-ID<sMq8a-1Fi-43@gated-at.bofh.it>
buf was allocated by kzalloc() so it should be passed to kfree()

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index ff111a82..593b7d1 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -183,15 +183,15 @@ static struct wm_adsp_buf *wm_adsp_buf_alloc(const void *src, size_t len,
 	struct wm_adsp_buf *buf = kzalloc(sizeof(*buf), GFP_KERNEL);
 
 	if (buf == NULL)
 		return NULL;
 
 	buf->buf = vmalloc(len);
 	if (!buf->buf) {
-		vfree(buf);
+		kfree(buf);
 		return NULL;
 	}
 	memcpy(buf->buf, src, len);
 
 	if (list)
 		list_add_tail(&buf->list, list);
 
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web