~ubuntu-branches/debian/lenny/linux-2.6/lenny

« back to all changes in this revision

Viewing changes to debian/patches/bugfix/sparc/sparc64-Fix-crash-with-proc-iomem.patch

  • Committer: Bazaar Package Importer
  • Author(s): dann frazier
  • Date: 2009-06-19 23:03:53 UTC
  • Revision ID: james.westby@ubuntu.com-20090619230353-0mpjz0ss2ccqozs1
Tags: 2.6.26-17
Revert "sata_nv: avoid link reset on controllers where it's broken"
due to regression. (closes: #533657)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
commit 192d7a4667c6d11d1a174ec4cad9a3c5d5f9043c
 
2
Author: Mikulas Patocka <mpatocka@redhat.com>
 
3
Date:   Wed Mar 18 23:53:16 2009 -0700
 
4
 
 
5
    sparc64: Fix crash with /proc/iomem
 
6
    
 
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.
 
10
    
 
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.
 
14
    
 
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.
 
17
    
 
18
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
 
19
    Signed-off-by: David S. Miller <davem@davemloft.net>
 
20
 
 
21
Backported to Debian's 2.6.26 by dann frazier <dannf@debian.org>
 
22
 
 
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);
 
28
 
 
29
        if (vdma) {
 
30
-               struct resource *rp = kmalloc(sizeof(*rp), GFP_KERNEL);
 
31
+               struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL);
 
32
 
 
33
                if (!rp) {
 
34
                        prom_printf("Cannot allocate IOMMU resource.\n");