powerpc/powernv: Skip registering log region when CONFIG_PRINTK=n
authorPranith Kumar <bobby.prani@gmail.com>
Thu, 22 Jan 2015 02:26:09 +0000 (21:26 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 27 Jan 2015 03:04:00 +0000 (14:04 +1100)
When CONFIG_PRINTK=n, log_buf_addr_get() returns NULL and log_buf_len_get()
return 0. Check for these return values and skip registering the dump buffer.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Reviewed-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/opal.c

index f10b9ec8c1f5c16fe9057014f5582791ee75a511..1db119f0f4ee54b6455845d7e5cd3e1229806e06 100644 (file)
@@ -667,7 +667,13 @@ static void __init opal_dump_region_init(void)
 
        /* Register kernel log buffer */
        addr = log_buf_addr_get();
+       if (addr == NULL)
+               return;
+
        size = log_buf_len_get();
+       if (size == 0)
+               return;
+
        rc = opal_register_dump_region(OPAL_DUMP_REGION_LOG_BUF,
                                       __pa(addr), size);
        /* Don't warn if this is just an older OPAL that doesn't