diff options
author | roel kluin <roel.kluin@gmail.com> | 2009-07-30 02:02:18 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-08-19 20:29:25 -0400 |
commit | 02a606c2c47a2e4714225d0c3513ca03679f01d2 (patch) | |
tree | 66956c5e420e06999986b1d2e0bdc5d3eabc049c | |
parent | cf68787b68a2011664f1670a827c8f202ddb7c3d (diff) |
powerpc: Missing tests for NULL after ioremap()
Missing tests after ioremap()
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/platforms/powermac/feature.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c index 095de3227d83..fbc9bbd74dbd 100644 --- a/arch/powerpc/platforms/powermac/feature.c +++ b/arch/powerpc/platforms/powermac/feature.c | |||
@@ -2589,9 +2589,16 @@ static void __init probe_uninorth(void) | |||
2589 | if (address == 0) | 2589 | if (address == 0) |
2590 | return; | 2590 | return; |
2591 | uninorth_base = ioremap(address, 0x40000); | 2591 | uninorth_base = ioremap(address, 0x40000); |
2592 | if (uninorth_base == NULL) | ||
2593 | return; | ||
2592 | uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); | 2594 | uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); |
2593 | if (uninorth_maj == 3 || uninorth_maj == 4) | 2595 | if (uninorth_maj == 3 || uninorth_maj == 4) { |
2594 | u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); | 2596 | u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000); |
2597 | if (u3_ht_base == NULL) { | ||
2598 | iounmap(uninorth_base); | ||
2599 | return; | ||
2600 | } | ||
2601 | } | ||
2595 | 2602 | ||
2596 | printk(KERN_INFO "Found %s memory controller & host bridge" | 2603 | printk(KERN_INFO "Found %s memory controller & host bridge" |
2597 | " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : | 2604 | " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : |