[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>
This commit is contained in:
Michael Ellerman 2006-06-23 18:20:10 +10:00 committed by Paul Mackerras
parent 4ba99b97da
commit 24da3dd534
1 changed files with 1 additions and 1 deletions

View File

@ -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... */