Patch "dmaengine: apple-admac: Fix 'current_tx' not getting freed" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dmaengine: apple-admac: Fix 'current_tx' not getting freed

to the 6.2-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-apple-admac-fix-current_tx-not-getting-fre.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 193a6cb0c0aa2d944b629b02e8d0cddee88c8f8d
Author: Martin Povišer <povik+lin@xxxxxxxxxxx>
Date:   Fri Feb 24 16:22:21 2023 +0100

    dmaengine: apple-admac: Fix 'current_tx' not getting freed
    
    [ Upstream commit d9503be5a100c553731c0e8a82c7b4201e8a970c ]
    
    In terminate_all we should queue up all submitted descriptors to be
    freed. We do that for the content of the 'issued' and 'submitted' lists,
    but the 'current_tx' descriptor falls through the cracks as it's
    removed from the 'issued' list once it gets assigned to be the current
    descriptor. Explicitly queue up freeing of the 'current_tx' descriptor
    to address a memory leak that is otherwise present.
    
    Fixes: b127315d9a78 ("dmaengine: apple-admac: Add Apple ADMAC driver")
    Signed-off-by: Martin Povišer <povik+lin@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230224152222.26732-2-povik+lin@xxxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/apple-admac.c b/drivers/dma/apple-admac.c
index b9132b495d181..4cf8da77bdd91 100644
--- a/drivers/dma/apple-admac.c
+++ b/drivers/dma/apple-admac.c
@@ -512,7 +512,10 @@ static int admac_terminate_all(struct dma_chan *chan)
 	admac_stop_chan(adchan);
 	admac_reset_rings(adchan);
 
-	adchan->current_tx = NULL;
+	if (adchan->current_tx) {
+		list_add_tail(&adchan->current_tx->node, &adchan->to_free);
+		adchan->current_tx = NULL;
+	}
 	/*
 	 * Descriptors can only be freed after the tasklet
 	 * has been killed (in admac_synchronize).



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux