]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: dw-dma: decrease reference count in dw_spi_dma_init_mfld()
authorXiongfeng Wang <wangxiongfeng2@huawei.com>
Wed, 16 Nov 2022 09:32:04 +0000 (17:32 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:39:59 +0000 (17:39 +0100)
commitfcb2d286362b19c07d5ea85878738e48422067ce
treedfac80a2d2ccae28862a5b615417c0a0944ea9d6
parent0b6441abfa5d3c193ba8b75c220aa61ba5a0040f
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@huawei.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Link: https://lore.kernel.org/r/20221116093204.46700-1-wangxiongfeng2@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-dw-dma.c