]> git.ozlabs.org Git - petitboot/blobdiff - discover/boot.c
discover: Fix potentially-unused var warning
[petitboot] / discover / boot.c
index 6109562491db79855655a4bf8431e07c20bd1e0f..e67ed00eec6b05de9845490c1b53241184675988 100644 (file)
@@ -103,6 +103,7 @@ int boot(void *ctx, struct boot_option *opt, struct boot_command *cmd,
        char *image, *initrd, *args;
        int result;
 
+       local_initrd = NULL;
        image = NULL;
        initrd = NULL;
        args = NULL;
@@ -117,9 +118,9 @@ int boot(void *ctx, struct boot_option *opt, struct boot_command *cmd,
        }
 
        if (cmd->initrd_file) {
-               image = talloc_strdup(ctx, cmd->initrd_file);
+               initrd = talloc_strdup(ctx, cmd->initrd_file);
        } else if (opt && opt->initrd_file) {
-               image = talloc_strdup(ctx, opt->initrd_file);
+               initrd = talloc_strdup(ctx, opt->initrd_file);
        }
 
        if (cmd->boot_args) {
@@ -134,7 +135,6 @@ int boot(void *ctx, struct boot_option *opt, struct boot_command *cmd,
        if (!local_image)
                goto no_load;
 
-       local_initrd = NULL;
        if (initrd) {
                local_initrd = load_file(NULL, initrd, &clean_initrd);
                if (!local_initrd)