X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fpower%2Fconsole.c;h=89bcf4973ee51cb8cc8028c6a3cf6a2272367b0a;hb=db292ca302e83534f5f0f7139e13d7e6976e51f9;hp=579d239d129fd5dd03458f8889577400b3b56aa1;hpb=6bd0e10e53cc4824cd8cdaab8c370e53ab2e23c2;p=linux-2.6 diff --git a/kernel/power/console.c b/kernel/power/console.c index 579d239d12..89bcf4973e 100644 --- a/kernel/power/console.c +++ b/kernel/power/console.c @@ -9,7 +9,9 @@ #include #include "power.h" -#ifdef SUSPEND_CONSOLE +#if defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) +#define SUSPEND_CONSOLE (MAX_NR_CONSOLES-1) + static int orig_fgconsole, orig_kmsg; int pm_prepare_console(void) @@ -25,7 +27,15 @@ int pm_prepare_console(void) return 1; } - set_console(SUSPEND_CONSOLE); + if (set_console(SUSPEND_CONSOLE)) { + /* + * We're unable to switch to the SUSPEND_CONSOLE. + * Let the calling function know so it can decide + * what to do. + */ + release_console_sem(); + return 1; + } release_console_sem(); if (vt_waitactive(SUSPEND_CONSOLE)) {