linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path
@ 2016-12-09  9:57 Richard Fitzgerald
  0 siblings, 0 replies; only message in thread
From: Richard Fitzgerald @ 2016-12-09  9:57 UTC (permalink / raw)
  To: broonie; +Cc: patches, alsa-devel, linux-kernel

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-09  9:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-09  9:57 [PATCH] ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path Richard Fitzgerald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).