diff mbox series

spi: add missing pci_dev_put() before return

Message ID 1644890386-65119-1-git-send-email-wangqing@vivo.com (mailing list archive)
State New, archived
Headers show
Series spi: add missing pci_dev_put() before return | expand

Commit Message

王擎 Feb. 15, 2022, 1:59 a.m. UTC
From: Wang Qing <wangqing@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@vivo.com>
---
 drivers/spi/spi-pxa2xx-pci.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Geert Uytterhoeven Feb. 23, 2022, 7:44 a.m. UTC | #1
Hi Qing,

On Tue, Feb 15, 2022 at 3:08 AM Qing Wang <wangqing@vivo.com> wrote:
> From: Wang Qing <wangqing@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@vivo.com>

Thanks for your patch!

Please use "spi: spi-topcliff-pch:" instead of just "spi:" in the patch
summary, as this is specific to the spi-topcliff-pch driver, not to the SPI
core.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Andy Shevchenko Feb. 23, 2022, 7:09 p.m. UTC | #2
On Tue, Feb 15, 2022 at 6:04 AM Qing Wang <wangqing@vivo.com> wrote:
>
> From: Wang Qing <wangqing@vivo.com>
>
> pci_get_slot() increases its reference count, the caller must
> decrement the reference count by calling pci_dev_put()

Thanks for the report!

This is not fully correct. I'll send a patch soon.
diff mbox series

Patch

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;
 }