aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 14c4c5613118..438d99a38c87 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -361,6 +361,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
361 void __user *, arg) 361 void __user *, arg)
362{ 362{
363 char buffer[256]; 363 char buffer[256];
364 int ret = 0;
364 365
365 /* We only trust the superuser with rebooting the system. */ 366 /* We only trust the superuser with rebooting the system. */
366 if (!capable(CAP_SYS_BOOT)) 367 if (!capable(CAP_SYS_BOOT))
@@ -398,7 +399,7 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
398 kernel_halt(); 399 kernel_halt();
399 unlock_kernel(); 400 unlock_kernel();
400 do_exit(0); 401 do_exit(0);
401 break; 402 panic("cannot halt");
402 403
403 case LINUX_REBOOT_CMD_POWER_OFF: 404 case LINUX_REBOOT_CMD_POWER_OFF:
404 kernel_power_off(); 405 kernel_power_off();
@@ -418,29 +419,22 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
418 419
419#ifdef CONFIG_KEXEC 420#ifdef CONFIG_KEXEC
420 case LINUX_REBOOT_CMD_KEXEC: 421 case LINUX_REBOOT_CMD_KEXEC:
421 { 422 ret = kernel_kexec();
422 int ret; 423 break;
423 ret = kernel_kexec();
424 unlock_kernel();
425 return ret;
426 }
427#endif 424#endif
428 425
429#ifdef CONFIG_HIBERNATION 426#ifdef CONFIG_HIBERNATION
430 case LINUX_REBOOT_CMD_SW_SUSPEND: 427 case LINUX_REBOOT_CMD_SW_SUSPEND:
431 { 428 ret = hibernate();
432 int ret = hibernate(); 429 break;
433 unlock_kernel();
434 return ret;
435 }
436#endif 430#endif
437 431
438 default: 432 default:
439 unlock_kernel(); 433 ret = -EINVAL;
440 return -EINVAL; 434 break;
441 } 435 }
442 unlock_kernel(); 436 unlock_kernel();
443 return 0; 437 return ret;
444} 438}
445 439
446static void deferred_cad(struct work_struct *dummy) 440static void deferred_cad(struct work_struct *dummy)