public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: shaohua li <shaoh.li@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, greg@kroah.com
Subject: [PATCH] call 'pci_dev_put' after pci_get_device
Date: Mon, 25 Oct 2004 17:47:52 +0800	[thread overview]
Message-ID: <288dbef704102502474fdd0c84@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

Hi,
Some code didn't call 'pci_dev_put' after pci_get_device. Below is an
incomplete list.

Thanks,
Shaohua

Signed-off-by: Li Shaohua <shaoh.li@gmail.com>

===== drivers/pci/pci.c 1.73 vs edited =====
--- 1.73/drivers/pci/pci.c	2004-10-07 00:42:55 +08:00
+++ edited/drivers/pci/pci.c	2004-10-25 17:30:36 +08:00
@@ -734,6 +734,7 @@ static int __devinit pci_init(void)
 
 	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		pci_fixup_device(pci_fixup_final, dev);
+		pci_dev_put(dev);
 	}
 	return 0;
 }
===== drivers/pci/quirks.c 1.55 vs edited =====
--- 1.55/drivers/pci/quirks.c	2004-10-20 00:54:38 +08:00
+++ edited/drivers/pci/quirks.c	2004-10-25 17:29:48 +08:00
@@ -38,6 +38,7 @@ static void __devinit quirk_passive_rele
 			dlc |= 1<<1;
 			pci_write_config_byte(d, 0x82, dlc);
 		}
+		pci_dev_put(d);
 	}
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82441,	quirk_passive_release
);
===== drivers/pci/setup-irq.c 1.5 vs edited =====
--- 1.5/drivers/pci/setup-irq.c	2004-10-07 00:44:51 +08:00
+++ edited/drivers/pci/setup-irq.c	2004-10-25 17:29:08 +08:00
@@ -67,5 +67,6 @@ pci_fixup_irqs(u8 (*swizzle)(struct pci_
 	struct pci_dev *dev = NULL;
 	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		pdev_fixup_irq(dev, swizzle, map_irq);
+		pci_dev_put(dev);
 	}
 }

[-- Attachment #2: pci_get_device.patch --]
[-- Type: application/octet-stream, Size: 1180 bytes --]

===== drivers/pci/pci.c 1.73 vs edited =====
--- 1.73/drivers/pci/pci.c	2004-10-07 00:42:55 +08:00
+++ edited/drivers/pci/pci.c	2004-10-25 17:30:36 +08:00
@@ -734,6 +734,7 @@ static int __devinit pci_init(void)
 
 	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		pci_fixup_device(pci_fixup_final, dev);
+		pci_dev_put(dev);
 	}
 	return 0;
 }
===== drivers/pci/quirks.c 1.55 vs edited =====
--- 1.55/drivers/pci/quirks.c	2004-10-20 00:54:38 +08:00
+++ edited/drivers/pci/quirks.c	2004-10-25 17:29:48 +08:00
@@ -38,6 +38,7 @@ static void __devinit quirk_passive_rele
 			dlc |= 1<<1;
 			pci_write_config_byte(d, 0x82, dlc);
 		}
+		pci_dev_put(d);
 	}
 }
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL,	PCI_DEVICE_ID_INTEL_82441,	quirk_passive_release );
===== drivers/pci/setup-irq.c 1.5 vs edited =====
--- 1.5/drivers/pci/setup-irq.c	2004-10-07 00:44:51 +08:00
+++ edited/drivers/pci/setup-irq.c	2004-10-25 17:29:08 +08:00
@@ -67,5 +67,6 @@ pci_fixup_irqs(u8 (*swizzle)(struct pci_
 	struct pci_dev *dev = NULL;
 	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
 		pdev_fixup_irq(dev, swizzle, map_irq);
+		pci_dev_put(dev);
 	}
 }

             reply	other threads:[~2004-10-25  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-25  9:47 shaohua li [this message]
2004-10-25 13:37 ` [PATCH] call 'pci_dev_put' after pci_get_device Brian Gerst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=288dbef704102502474fdd0c84@mail.gmail.com \
    --to=shaoh.li@gmail.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox