summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas.c
diff options
context:
space:
mode:
authorMichael Ellerman2006-06-23 10:20:10 +0200
committerPaul Mackerras2006-06-28 03:59:47 +0200
commit24da3dd53430ec07ce9110b1eaaad080c3c7ecf6 (patch)
tree1c71b06224549fbc5b4860e7b38a1777ca3fbaea /arch/powerpc/kernel/rtas.c
parent[POWERPC] Setup the boot cpu's paca pointer in C rather than asm (diff)
downloadkernel-qcow2-linux-24da3dd53430ec07ce9110b1eaaad080c3c7ecf6.tar.gz
kernel-qcow2-linux-24da3dd53430ec07ce9110b1eaaad080c3c7ecf6.tar.xz
kernel-qcow2-linux-24da3dd53430ec07ce9110b1eaaad080c3c7ecf6.zip
[POWERPC] Make rtas_call() safe if RTAS hasn't been initialised
Currently it's unsafe to call rtas_call() prior to rtas_initialize(). This is because the rtas.entry value hasn't been setup and so we don't know where to enter, but we just try anyway. We can't do anything intelligent without rtas.entry, so if it's not set, just return. Code that calls rtas_call() early needs to be aware that the call might fail. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r--arch/powerpc/kernel/rtas.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index 17dc79198515..0f14c2e63a67 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -328,7 +328,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
char *buff_copy = NULL;
int ret;
- if (token == RTAS_UNKNOWN_SERVICE)
+ if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE)
return -1;
/* Gotta do something different here, use global lock for now... */