From: Jeremy Kerr Date: Tue, 16 Apr 2013 08:07:33 +0000 (+0800) Subject: discover: Fix potentially-unused var warning X-Git-Tag: v1.0.0~704 X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=359f12f9eb0440294a8be1b78ade1b69926d2896 discover: Fix potentially-unused var warning 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 --- diff --git a/discover/boot.c b/discover/boot.c index 02618cc..e67ed00 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -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; @@ -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)