From 9bc9a6bc734707bfecf58a8c68bab8478c16cae6 Mon Sep 17 00:00:00 2001 From: Mark Farrugia Date: Fri, 23 Nov 2018 16:36:52 +1100 Subject: 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 --- pcm.c | 7 ++----- 1 file 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); -- cgit 1.2.3-korg