lkml.org 
[lkml]   [2005]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectPCI: fix an oops in some pci devices on hotplug remove when their resources are being freed.
Date
From
ChangeSet 1.2181.16.7, 2005/03/17 10:30:46-08:00, gregkh@suse.de

PCI: fix an oops in some pci devices on hotplug remove when their resources are being freed.

As reported by Prarit Bhargava <prarit@sgi.com>

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


drivers/pci/remove.c | 2 +-
kernel/resource.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)


diff -Nru a/drivers/pci/remove.c b/drivers/pci/remove.c
--- a/drivers/pci/remove.c 2005-04-01 15:37:58 -08:00
+++ b/drivers/pci/remove.c 2005-04-01 15:37:58 -08:00
@@ -19,7 +19,7 @@
pci_cleanup_rom(dev);
for (i = 0; i < PCI_NUM_RESOURCES; i++) {
struct resource *res = dev->resource + i;
- if (res->parent)
+ if (res && res->parent)
release_resource(res);
}
}
diff -Nru a/kernel/resource.c b/kernel/resource.c
--- a/kernel/resource.c 2005-04-01 15:37:58 -08:00
+++ b/kernel/resource.c 2005-04-01 15:37:58 -08:00
@@ -505,6 +505,7 @@
*p = res->sibling;
write_unlock(&resource_lock);
kfree(res);
+ res = NULL;
return;
}
p = &res->sibling;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-04-06 13:31    [W:0.091 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site