2019-03-29 14:12:17 +08:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-16 02:05:43 +08:00
|
|
|
From: "Panwar, Ashish" <ashish.panwar@intel.com>
|
|
|
|
Date: Fri, 4 Mar 2016 11:20:00 +0530
|
2019-03-29 14:12:17 +08:00
|
|
|
Subject: [PATCH] ASoC: Intel: Skylake: Convert buffer size to # of u32
|
2018-10-16 02:05:43 +08:00
|
|
|
elements before allocating memory
|
|
|
|
|
|
|
|
While allocating memory, kfifo expects the number of elements in arguments
|
|
|
|
and not the # of bytes. Due to this, kfifo is currently allocating 4 times
|
|
|
|
the memory requested by user. Convert buffer size to the number of elements
|
|
|
|
before allocating memory.
|
|
|
|
|
|
|
|
Change-Id: Ib8938bc1645896a5b342aa7fe5602b4e415960a6
|
|
|
|
Signed-off-by: Panwar, Ashish <ashish.panwar@intel.com>
|
|
|
|
Reviewed-on:
|
|
|
|
Reviewed-by: Babu, Ramesh <ramesh.babu@intel.com>
|
|
|
|
Tested-by: Babu, Ramesh <ramesh.babu@intel.com>
|
|
|
|
---
|
|
|
|
sound/soc/intel/skylake/skl-pcm.c | 1 +
|
|
|
|
1 file changed, 1 insertion(+)
|
|
|
|
|
|
|
|
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
|
2019-03-29 14:12:17 +08:00
|
|
|
index 284e34f..d462b1b 100644
|
2018-10-16 02:05:43 +08:00
|
|
|
--- a/sound/soc/intel/skylake/skl-pcm.c
|
|
|
|
+++ b/sound/soc/intel/skylake/skl-pcm.c
|
|
|
|
@@ -779,6 +779,7 @@ static int skl_trace_compr_set_params(struct snd_compr_stream *stream,
|
|
|
|
if (!skl_is_core_valid(core))
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ size = size / sizeof(u32);
|
|
|
|
if (size & (size - 1)) {
|
|
|
|
dev_err(sst->dev, "Buffer size must be a power of 2\n");
|
|
|
|
return -EINVAL;
|
|
|
|
--
|
2019-04-08 18:08:36 +08:00
|
|
|
https://clearlinux.org
|
2018-10-16 02:05:43 +08:00
|
|
|
|