summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-23 16:36:52 +1100
committerMark Farrugia <mark.farrugia@fiberdyne.com.au>2018-11-23 16:36:52 +1100
commit9bc9a6bc734707bfecf58a8c68bab8478c16cae6 (patch)
tree77242f8ae00e4cda1e9c79060e52d71725f24b77
parent4d67fe2f36b0761cdae7080a5e474a9f871377e3 (diff)
Fix vmalloc failure for some platforms
On the Intel minnowboard, vmalloc was failing for such a large amount of requested memory. We do not need to be requesting so much. Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
-rw-r--r--pcm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/pcm.c b/pcm.c
index a4f7f0e..ff1b5fc 100644
--- a/pcm.c
+++ b/pcm.c
@@ -121,7 +121,6 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
int retval;
- size_t bufsz;
/* Check supported channels */
if ((params_channels(hw_params) <
@@ -133,10 +132,8 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,
return -EINVAL;
}
- bufsz = params_buffer_bytes(hw_params) *
- substream->runtime->hw.periods_max;
-
- retval = snd_pcm_lib_alloc_vmalloc_buffer(substream, bufsz);
+ retval = snd_pcm_lib_alloc_vmalloc_buffer(
+ substream, params_buffer_bytes(hw_params));
if (retval < 0)
D_ERRORK("pcm: buffer allocation failed: %d", retval);