summaryrefslogtreecommitdiff
path: root/bootctl
diff options
context:
space:
mode:
Diffstat (limited to 'bootctl')
-rw-r--r--bootctl/bootctl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/bootctl/bootctl.c b/bootctl/bootctl.c
index 8e0125c4..55eb5bf4 100644
--- a/bootctl/bootctl.c
+++ b/bootctl/bootctl.c
@@ -147,6 +147,11 @@ int main(int argc, char *argv[])
boot_control_module_t *module;
int ret;
+ if (argc < 2) {
+ usage(stderr, argc, argv);
+ return EX_USAGE;
+ }
+
ret = hw_get_module("bootctrl", &hw_module);
if (ret != 0) {
fprintf(stderr, "Error getting bootctrl module.\n");
@@ -155,11 +160,6 @@ int main(int argc, char *argv[])
module = (boot_control_module_t*) hw_module;
module->init(module);
- if (argc < 2) {
- usage(stderr, argc, argv);
- return EX_USAGE;
- }
-
if (strcmp(argv[1], "hal-info") == 0) {
return do_hal_info(hw_module);
} else if (strcmp(argv[1], "get-number-slots") == 0) {