Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / kernel / power / user.c
index 3f1539f..0ef5e4b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/swapops.h>
 #include <linux/pm.h>
 #include <linux/fs.h>
+#include <linux/cpu.h>
 
 #include <asm/uaccess.h>
 
@@ -139,12 +140,15 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
                if (data->frozen)
                        break;
                down(&pm_sem);
-               disable_nonboot_cpus();
-               if (freeze_processes()) {
-                       thaw_processes();
-                       enable_nonboot_cpus();
-                       error = -EBUSY;
+               error = disable_nonboot_cpus();
+               if (!error) {
+                       error = freeze_processes();
+                       if (error) {
+                               thaw_processes();
+                               error = -EBUSY;
+                       }
                }
+               enable_nonboot_cpus();
                up(&pm_sem);
                if (!error)
                        data->frozen = 1;