]> git.ozlabs.org Git - petitboot/commitdiff
discover: Fix potentially-unused var warning
authorJeremy Kerr <jk@ozlabs.org>
Tue, 16 Apr 2013 08:07:33 +0000 (16:07 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 29 Apr 2013 02:42:23 +0000 (12:42 +1000)
discover/boot.c: In function ‘boot’:
discover/boot.c:153:13: error: ‘local_initrd’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
discover/boot.c

index 02618cce1251fd070e3baec29c27bac762141c45..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;
 
        char *image, *initrd, *args;
        int result;
 
+       local_initrd = NULL;
        image = NULL;
        initrd = NULL;
        args = NULL;
        image = NULL;
        initrd = NULL;
        args = NULL;
@@ -134,7 +135,6 @@ int boot(void *ctx, struct boot_option *opt, struct boot_command *cmd,
        if (!local_image)
                goto no_load;
 
        if (!local_image)
                goto no_load;
 
-       local_initrd = NULL;
        if (initrd) {
                local_initrd = load_file(NULL, initrd, &clean_initrd);
                if (!local_initrd)
        if (initrd) {
                local_initrd = load_file(NULL, initrd, &clean_initrd);
                if (!local_initrd)