diff options
author | Wang Qing <wangqing@vivo.com> | 2022-02-15 05:00:07 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-02-23 05:04:17 +0300 |
commit | 4d986ffa036a773456476f70bd0fde2fb1330b7d (patch) | |
tree | d28d30135d7173c2ffd412c292ce3abb9179bc0d /drivers/spi/spi-topcliff-pch.c | |
parent | 1847e3046c528bd85bd51e2860f4139bd9052d6c (diff) | |
download | linux-4d986ffa036a773456476f70bd0fde2fb1330b7d.tar.xz |
spi: add missing pci_dev_put() before return
pci_get_slot() increases its reference count, the caller must
decrement the reference count by calling pci_dev_put()
Signed-off-by: Wang Qing <wangqing@vivo.com>
Link: https://lore.kernel.org/r/1644890407-65167-1-git-send-email-wangqing@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-topcliff-pch.c')
-rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index 8c4615b76339..8e1cc345810a 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c @@ -877,7 +877,7 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw) dev_err(&data->master->dev, "ERROR: dma_request_channel FAILS(Tx)\n"); data->use_dma = 0; - return; + goto out; } dma->chan_tx = chan; @@ -894,9 +894,12 @@ static void pch_spi_request_dma(struct pch_spi_data *data, int bpw) dma_release_channel(dma->chan_tx); dma->chan_tx = NULL; data->use_dma = 0; - return; + goto out; } dma->chan_rx = chan; + +out: + pci_dev_put(dma_dev); } static void pch_spi_release_dma(struct pch_spi_data *data) |