Commit 24da3dd5 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[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: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 4ba99b97
...@@ -328,7 +328,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...) ...@@ -328,7 +328,7 @@ int rtas_call(int token, int nargs, int nret, int *outputs, ...)
char *buff_copy = NULL; char *buff_copy = NULL;
int ret; int ret;
if (token == RTAS_UNKNOWN_SERVICE) if (!rtas.entry || token == RTAS_UNKNOWN_SERVICE)
return -1; return -1;
/* Gotta do something different here, use global lock for now... */ /* Gotta do something different here, use global lock for now... */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment