mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] via82cxxx_audio: Use pci_get_device
@ 2006-09-15 14:07 Alan Cox
  0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2006-09-15 14:07 UTC (permalink / raw)
  To: linux-kernel, akpm, jgarzik

pci_find_device is not refcounting and should be getting killed off.

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.18-rc6-mm1/sound/oss/via82cxxx_audio.c linux-2.6.18-rc6-mm1/sound/oss/via82cxxx_audio.c
--- linux.vanilla-2.6.18-rc6-mm1/sound/oss/via82cxxx_audio.c	2006-09-11 11:02:49.000000000 +0100
+++ linux-2.6.18-rc6-mm1/sound/oss/via82cxxx_audio.c	2006-09-14 17:29:54.000000000 +0100
@@ -1547,7 +1547,7 @@
 
 	DPRINTK ("ENTER\n");
 
-	while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+	while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
 		drvr = pci_dev_driver (pdev);
 		if (drvr == &via_driver) {
 			assert (pci_get_drvdata (pdev) != NULL);
@@ -1562,6 +1562,7 @@
 	return -ENODEV;
 
 match:
+	pci_dev_put(pdev);
 	file->private_data = card->ac97;
 
 	DPRINTK ("EXIT, returning 0\n");
@@ -3245,7 +3246,7 @@
 	}
 
 	card = NULL;
-	while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
+	while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
 		drvr = pci_dev_driver (pdev);
 		if (drvr == &via_driver) {
 			assert (pci_get_drvdata (pdev) != NULL);
@@ -3264,6 +3265,7 @@
 	return -ENODEV;
 
 match:
+	pci_dev_put(pdev);
 	if (nonblock) {
 		if (!mutex_trylock(&card->open_mutex)) {
 			DPRINTK ("EXIT, returning -EAGAIN\n");


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-15 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-15 14:07 [PATCH] via82cxxx_audio: Use pci_get_device Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome