ASoC: wm_adsp: wm_adsp_buf_alloc should use kfree in error path
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
Fri, 9 Dec 2016 09:57:41 +0000 (09:57 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 12 Dec 2016 15:51:59 +0000 (15:51 +0000)
buf was allocated by kzalloc() so it should be passed to kfree()

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm_adsp.c

index ff111a82fa3fd8d53f9ab61da1372c1fb33706dc..593b7d1aed4695bbf6e538fa924bc6263901041f 100644 (file)
@@ -187,7 +187,7 @@ static struct wm_adsp_buf *wm_adsp_buf_alloc(const void *src, size_t len,
 
        buf->buf = vmalloc(len);
        if (!buf->buf) {
-               vfree(buf);
+               kfree(buf);
                return NULL;
        }
        memcpy(buf->buf, src, len);