summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2015-03-30 14:10:37 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-10 20:02:48 +1000
commitf691fa1080c37c48da0cdfeae082c3bef5df2643 (patch)
treefc961091a54c1be106c320108b231b340a979888 /arch/powerpc/kernel/rtas.c
parent4f9c53c8cc76ed84e3bb0cca8c4ffa2b170d0239 (diff)
downloadop-kernel-dev-f691fa1080c37c48da0cdfeae082c3bef5df2643.zip
op-kernel-dev-f691fa1080c37c48da0cdfeae082c3bef5df2643.tar.gz
powerpc: Replace mem_init_done with slab_is_available()
We have a powerpc specific global called mem_init_done which is "set on boot once kmalloc can be called". But that's not *quite* true. We set it at the bottom of mem_init(), and rely on the fact that mm_init() calls kmem_cache_init() immediately after that, and nothing is running in parallel. So replace it with the generic and 100% correct slab_is_available(). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r--arch/powerpc/kernel/rtas.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index b9a7b89..7a488c1 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -401,7 +401,7 @@ static char *__fetch_rtas_last_error(char *altbuf)
buf = altbuf;
} else {
buf = rtas_err_buf;
- if (mem_init_done)
+ if (slab_is_available())
buf = kmalloc(RTAS_ERROR_LOG_MAX, GFP_ATOMIC);
}
if (buf)
@@ -461,7 +461,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
if (buff_copy) {
log_error(buff_copy, ERR_TYPE_RTAS_LOG, 0);
- if (mem_init_done)
+ if (slab_is_available())
kfree(buff_copy);
}
return ret;
OpenPOWER on IntegriCloud