Patch "spi: dw-dma: decrease reference count in dw_spi_dma_init_mfld()" has been added to the 5.15-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

    spi: dw-dma: decrease reference count in dw_spi_dma_init_mfld()

to the 5.15-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:
     spi-dw-dma-decrease-reference-count-in-dw_spi_dma_in.patch
and it can be found in the queue-5.15 subdirectory.

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



commit bcfca3135a1642496a31e9dfd7c4b8b01c10459f
Author: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>
Date:   Wed Nov 16 17:32:04 2022 +0800

    spi: dw-dma: decrease reference count in dw_spi_dma_init_mfld()
    
    [ Upstream commit 804313b64e412a81b0b3389a10e7622452004aa6 ]
    
    pci_get_device() will increase the reference count for the returned
    pci_dev. Since 'dma_dev' is only used to filter the channel in
    dw_spi_dma_chan_filer() after using it we need to call pci_dev_put() to
    decrease the reference count. Also add pci_dev_put() for the error case.
    
    Fixes: 7063c0d942a1 ("spi/dw_spi: add DMA support")
    Signed-off-by: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>
    Acked-by: Serge Semin <fancer.lancer@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20221116093204.46700-1-wangxiongfeng2@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
index a09831c62192..32ac8f9068e8 100644
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -127,12 +127,15 @@ static int dw_spi_dma_init_mfld(struct device *dev, struct dw_spi *dws)
 
 	dw_spi_dma_sg_burst_init(dws);
 
+	pci_dev_put(dma_dev);
+
 	return 0;
 
 free_rxchan:
 	dma_release_channel(dws->rxchan);
 	dws->rxchan = NULL;
 err_exit:
+	pci_dev_put(dma_dev);
 	return -EBUSY;
 }
 



[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