Skip to contentSkip to conversation

ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path

PATCH New Richard Fitzgerald 1 participant 1 message Dec 9, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path

buf was allocated by kzalloc() so it should be passed to kfree()

---
 sound/soc/codecs/wm_adsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/wm_adsp.c +1 -1
index ff111a82..593b7d1 100644
@@ -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);
 
Signature · 1 line
1.9.1