This is a note to let you know that I've just added the patch titled dmaengine: stm32-mdma: abort resume if no ongoing transfer to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: dmaengine-stm32-mdma-abort-resume-if-no-ongoing-transfer.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 81337b9a72dc58a5fa0ae8a042e8cb59f9bdec4a Mon Sep 17 00:00:00 2001 From: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx> Date: Wed, 4 Oct 2023 18:35:28 +0200 Subject: dmaengine: stm32-mdma: abort resume if no ongoing transfer From: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx> commit 81337b9a72dc58a5fa0ae8a042e8cb59f9bdec4a upstream. chan->desc can be null, if transfer is terminated when resume is called, leading to a NULL pointer when retrieving the hwdesc. To avoid this case, check that chan->desc is not null and channel is disabled (transfer previously paused or terminated). Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver") Signed-off-by: Amelie Delaunay <amelie.delaunay@xxxxxxxxxxx> Cc: stable@xxxxxxxxxxxxxxx Link: https://lore.kernel.org/r/20231004163531.2864160-1-amelie.delaunay@xxxxxxxxxxx Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/dma/stm32-mdma.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -1237,6 +1237,10 @@ static int stm32_mdma_resume(struct dma_ unsigned long flags; u32 status, reg; + /* Transfer can be terminated */ + if (!chan->desc || (stm32_mdma_read(dmadev, STM32_MDMA_CCR(chan->id)) & STM32_MDMA_CCR_EN)) + return -EPERM; + hwdesc = chan->desc->node[chan->curr_hwdesc].hwdesc; spin_lock_irqsave(&chan->vchan.lock, flags); Patches currently in stable-queue which might be from amelie.delaunay@xxxxxxxxxxx are queue-6.1/dmaengine-stm32-dma-fix-residue-in-case-of-mdma-chaining.patch queue-6.1/dmaengine-stm32-mdma-abort-resume-if-no-ongoing-transfer.patch queue-6.1/dmaengine-stm32-mdma-set-in_flight_bytes-in-case-crqa-flag-is-set.patch queue-6.1/dmaengine-stm32-mdma-use-link-address-register-to-compute-residue.patch queue-6.1/dmaengine-stm32-dma-fix-stm32_dma_prep_slave_sg-in-case-of-mdma-chaining.patch