提交 02a606c2 编写于 作者: R roel kluin 提交者: Benjamin Herrenschmidt

powerpc: Missing tests for NULL after ioremap()

Missing tests after ioremap()
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 cf68787b
...@@ -2589,9 +2589,16 @@ static void __init probe_uninorth(void) ...@@ -2589,9 +2589,16 @@ static void __init probe_uninorth(void)
if (address == 0) if (address == 0)
return; return;
uninorth_base = ioremap(address, 0x40000); uninorth_base = ioremap(address, 0x40000);
if (uninorth_base == NULL)
return;
uninorth_rev = in_be32(UN_REG(UNI_N_VERSION)); 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); 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" printk(KERN_INFO "Found %s memory controller & host bridge"
" @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" : " @ 0x%08x revision: 0x%02x\n", uninorth_maj == 3 ? "U3" :
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册