1
commit 192d7a4667c6d11d1a174ec4cad9a3c5d5f9043c
2
Author: Mikulas Patocka <mpatocka@redhat.com>
3
Date: Wed Mar 18 23:53:16 2009 -0700
5
sparc64: Fix crash with /proc/iomem
7
When you compile kernel on Sparc64 with heap memory checking and type
8
"cat /proc/iomem", you get a crash, because pointers in struct
9
resource are uninitialized.
11
Most code fills struct resource with zeros, so I assume that it is
12
responsibility of the caller of request_resource to initialized it,
13
not the responsibility of request_resource functuion.
15
After 2.6.29 is out, there could be a check for uninitialized fields
16
added to request_resource to avoid crashes like this.
18
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
19
Signed-off-by: David S. Miller <davem@davemloft.net>
21
Backported to Debian's 2.6.26 by dann frazier <dannf@debian.org>
23
diff -urpN linux-source-2.6.26.orig/arch/sparc64/kernel/pci_common.c linux-source-2.6.26/arch/sparc64/kernel/pci_common.c
24
--- linux-source-2.6.26.orig/arch/sparc64/kernel/pci_common.c 2009-05-11 12:06:56.000000000 -0600
25
+++ linux-source-2.6.26/arch/sparc64/kernel/pci_common.c 2009-06-09 00:05:23.000000000 -0600
26
@@ -368,7 +368,7 @@ static void pci_register_iommu_region(st
27
const u32 *vdma = of_get_property(pbm->prom_node, "virtual-dma", NULL);
30
- struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL);
31
+ struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL);
34
prom_printf("Cannot allocate IOMMU resource.\n");