powerpc: Missing tests for NULL after ioremap()
authorroel kluin <roel.kluin@gmail.com>
Thu, 30 Jul 2009 06:02:18 +0000 (06:02 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 20 Aug 2009 00:29:25 +0000 (10:29 +1000)
Missing tests after ioremap()

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powermac/feature.c

index 095de3227d838114442ca7e4ca7af19b761277c8..fbc9bbd74dbdc9337ca2880f1d50a590d8f9f3a1 100644 (file)
@@ -2589,9 +2589,16 @@ static void __init probe_uninorth(void)
        if (address == 0)
                return;
        uninorth_base = ioremap(address, 0x40000);
+       if (uninorth_base == NULL)
+               return;
        uninorth_rev = in_be32(UN_REG(UNI_N_VERSION));
-       if (uninorth_maj == 3 || uninorth_maj == 4)
+       if (uninorth_maj == 3 || uninorth_maj == 4) {
                u3_ht_base = ioremap(address + U3_HT_CONFIG_BASE, 0x1000);
+               if (u3_ht_base == NULL) {
+                       iounmap(uninorth_base);
+                       return;
+               }
+       }
 
        printk(KERN_INFO "Found %s memory controller & host bridge"
               " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" :