mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PCI: fix pci_remove_legacy_files() crash
@ 2005-02-04  3:28 MUNEDA Takahiro
  2005-02-04 16:45 ` Jesse Barnes
  2005-02-08  0:19 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: MUNEDA Takahiro @ 2005-02-04  3:28 UTC (permalink / raw)
  To: Greg KH, John Rose, Jesse Barnes; +Cc: muneda.takahiro, LKML, linux-pci

Hi,

The legacy_io which is the member of pci_bus struct might be
NULL. It should be checked.

This patch checks 'b->legacy_io', NULL or not.

Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>

---

 probe.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff -Npur a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	2005-01-31 13:31:27.000000000 +0900
+++ b/drivers/pci/probe.c	2005-02-03 11:21:51.000000000 +0900
@@ -64,9 +64,11 @@ static void pci_create_legacy_files(stru

 void pci_remove_legacy_files(struct pci_bus *b)
 {
-	class_device_remove_bin_file(&b->class_dev, b->legacy_io);
-	class_device_remove_bin_file(&b->class_dev, b->legacy_mem);
-	kfree(b->legacy_io); /* both are allocated here */
+	if (b->legacy_io) {
+		class_device_remove_bin_file(&b->class_dev, b->legacy_io);
+		class_device_remove_bin_file(&b->class_dev, b->legacy_mem);
+		kfree(b->legacy_io); /* both are allocated here */
+	}
 }
 #else /* !HAVE_PCI_LEGACY */
 static inline void pci_create_legacy_files(struct pci_bus *bus) { return; }


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] PCI: Make pci_claim_resource __devinit
@ 2005-03-04 20:53 Greg KH
  2005-03-04 20:53 ` [PATCH] PCI: fix pci_remove_legacy_files() crash Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2005-03-04 20:53 UTC (permalink / raw)
  To: linux-kernel, linux-pci; +Cc: matthew

ChangeSet 1.1998.11.10, 2005/02/07 14:38:32-08:00, matthew@wil.cx

[PATCH] PCI: Make pci_claim_resource __devinit

ia64 calls pci_claim_resource() from pcibios_fixup_bus(), which is
__devinit, so pci_claim_resource() needs to be __devinit too.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/setup-res.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
--- a/drivers/pci/setup-res.c	2005-03-04 12:43:06 -08:00
+++ b/drivers/pci/setup-res.c	2005-03-04 12:43:06 -08:00
@@ -90,7 +90,7 @@
 		new & ~PCI_REGION_FLAG_MASK));
 }
 
-int __init
+int __devinit
 pci_claim_resource(struct pci_dev *dev, int resource)
 {
 	struct resource *res = &dev->resource[resource];


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-03-04 23:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-04  3:28 [PATCH] PCI: fix pci_remove_legacy_files() crash MUNEDA Takahiro
2005-02-04 16:45 ` Jesse Barnes
2005-02-08  0:19 ` Greg KH
2005-03-04 20:53 [PATCH] PCI: Make pci_claim_resource __devinit Greg KH
2005-03-04 20:53 ` [PATCH] PCI: fix pci_remove_legacy_files() crash Greg KH

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

all inboxes | Powered by JetHome®