[PATCH] spi: add missing pci_dev_put() before return

Qing Wang wangqing at vivo.com
Mon Feb 14 17:59:46 PST 2022


From: Wang Qing <wangqing at vivo.com>

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 at vivo.com>
---
 drivers/spi/spi-pxa2xx-pci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 2e134eb..5fb2f44
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -102,6 +102,8 @@ static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
 	}
 
 	c->dma_filter = lpss_dma_filter;
+	pci_dev_put(dma_dev);
+
 	return 0;
 }
 
-- 
2.7.4




More information about the linux-arm-kernel mailing list