[PATCH] swsusp: fix suspend when console is in VT_AUTO+KD_GRAPHICS mode
[powerpc.git] / kernel / power / console.c
index 623786d..89bcf49 100644 (file)
@@ -27,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)) {