Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sparc64: Fix crash with /proc/iomem

When you compile kernel on Sparc64 with heap memory checking and type
"cat /proc/iomem", you get a crash, because pointers in struct
resource are uninitialized.

Most code fills struct resource with zeros, so I assume that it is
responsibility of the caller of request_resource to initialized it,
not the responsibility of request_resource functuion.

After 2.6.29 is out, there could be a check for uninitialized fields
added to request_resource to avoid crashes like this.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mikulas Patocka and committed by
David S. Miller
192d7a46 42cc77c8

+1 -1
+1 -1
arch/sparc/kernel/pci_common.c
··· 368 368 const u32 *vdma = of_get_property(pbm->op->node, "virtual-dma", NULL); 369 369 370 370 if (vdma) { 371 - struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL); 371 + struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); 372 372 373 373 if (!rp) { 374 374 prom_printf("Cannot allocate IOMMU resource.\n");