From 6a895a2c4c6941dd35d8308a7af695956c338baa Mon Sep 17 00:00:00 2001 From: Shengjiu Wang Date: Mon, 23 Mar 2020 17:32:13 +0800 Subject: MLK-23650-2: ASoC: fsl_asrc_m2m: Fix oops error Don't need to add one more buffer, if the buffer size is same as ASRC_MAX_BUFFER_SIZE. Signed-off-by: Shengjiu Wang Reviewed-by: Viorel Suman --- sound/soc/fsl/fsl_asrc_m2m.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sound/soc/fsl/fsl_asrc_m2m.c') diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c index ea4f863caee1..406d513ee1cf 100644 --- a/sound/soc/fsl/fsl_asrc_m2m.c +++ b/sound/soc/fsl/fsl_asrc_m2m.c @@ -307,7 +307,9 @@ static int fsl_asrc_prepare_io_buffer(struct fsl_asrc_pair *pair, * (word_size * pair->channels * m2m->watermark[OUT]); } - *sg_nodes = *dma_len / ASRC_MAX_BUFFER_SIZE + 1; + *sg_nodes = *dma_len / ASRC_MAX_BUFFER_SIZE; + if (*dma_len % ASRC_MAX_BUFFER_SIZE) + *sg_nodes += 1; fifo_addr = asrc_priv->paddr + REG_ASRDx(dir, index); -- cgit v1.2.3