diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-11-30 20:11:26 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-10 05:40:10 -0500 |
commit | d4accd60d23f3c8a576fd08b727f88096f42d445 (patch) | |
tree | a1d490ef2eebbdedf3703f4ae0829bf85d8efbfe /arch/sparc | |
parent | c80892d150a872b18cedfbf789211bfbebfc67ce (diff) |
[SPARC]: Check kzalloc() return value in SUN4D irq/iommu init.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/sun4d_irq.c | 4 | ||||
-rw-r--r-- | arch/sparc/mm/io-unit.c | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index b8bd53ab29c5..cf1b8baa57ea 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -546,6 +546,10 @@ void __init sun4d_init_sbi_irq(void) | |||
546 | for_each_sbus(sbus) | 546 | for_each_sbus(sbus) |
547 | nsbi++; | 547 | nsbi++; |
548 | sbus_actions = kzalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC); | 548 | sbus_actions = kzalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC); |
549 | if (!sbus_actions) { | ||
550 | prom_printf("SUN4D: Cannot allocate sbus_actions, halting.\n"); | ||
551 | prom_halt(); | ||
552 | } | ||
549 | for_each_sbus(sbus) { | 553 | for_each_sbus(sbus) { |
550 | #ifdef CONFIG_SMP | 554 | #ifdef CONFIG_SMP |
551 | extern unsigned char boot_cpu_id; | 555 | extern unsigned char boot_cpu_id; |
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index 007062022967..4ccda77d08d6 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
23 | #include <asm/tlbflush.h> | 23 | #include <asm/tlbflush.h> |
24 | #include <asm/dma.h> | 24 | #include <asm/dma.h> |
25 | #include <asm/oplib.h> | ||
25 | 26 | ||
26 | /* #define IOUNIT_DEBUG */ | 27 | /* #define IOUNIT_DEBUG */ |
27 | #ifdef IOUNIT_DEBUG | 28 | #ifdef IOUNIT_DEBUG |
@@ -42,6 +43,10 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus) | |||
42 | struct resource r; | 43 | struct resource r; |
43 | 44 | ||
44 | iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC); | 45 | iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC); |
46 | if (!iounit) { | ||
47 | prom_printf("SUN4D: Cannot alloc iounit, halting.\n"); | ||
48 | prom_halt(); | ||
49 | } | ||
45 | 50 | ||
46 | iounit->limit[0] = IOUNIT_BMAP1_START; | 51 | iounit->limit[0] = IOUNIT_BMAP1_START; |
47 | iounit->limit[1] = IOUNIT_BMAP2_START; | 52 | iounit->limit[1] = IOUNIT_BMAP2_START; |