summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-11-08 14:23:32 +0800
committerJeremy Kerr <jk@ozlabs.org>2013-11-13 14:25:02 +0800
commit59dbd08e2a8354e71578c0d7ca2283951a384801 (patch)
treec860fad5656275eead197e7b685b6ce11dfaa7f4
parent9d966d3d4a0d37ff8e3ca17e8cbca34feb4828dd (diff)
downloadtalos-petitboot-59dbd08e2a8354e71578c0d7ca2283951a384801.tar.gz
talos-petitboot-59dbd08e2a8354e71578c0d7ca2283951a384801.zip
discover: Fix potentially-uninitialised variables
We've been compiling with --enable-debug; this change fixes some problems exposed by the optimiser. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--discover/grub2/script.c2
-rw-r--r--discover/network.c1
-rw-r--r--discover/pxe-parser.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/discover/grub2/script.c b/discover/grub2/script.c
index 2aaf1d3..e29d437 100644
--- a/discover/grub2/script.c
+++ b/discover/grub2/script.c
@@ -320,7 +320,7 @@ int statement_if_execute(struct grub2_script *script,
struct grub2_statement_if *st = to_stmt_if(statement);
struct grub2_statement *conditional;
bool executed;
- int rc;
+ int rc = 0;
list_for_each_entry(&st->conditionals->list, conditional, list) {
rc = statement_conditional_execute(script,
diff --git a/discover/network.c b/discover/network.c
index b9b0c50..87075fc 100644
--- a/discover/network.c
+++ b/discover/network.c
@@ -369,6 +369,7 @@ static int network_handle_nlmsg(struct network *network, struct nlmsghdr *nlmsg)
info = NLMSG_DATA(nlmsg);
have_ifaddr = have_ifname = false;
+ mtu = 1;
attrlen = nlmsg->nlmsg_len - sizeof(*info);
diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c
index bc07a13..811679d 100644
--- a/discover/pxe-parser.c
+++ b/discover/pxe-parser.c
@@ -132,6 +132,8 @@ static int pxe_parse(struct discover_context *dc)
if (!pxe_conf_files)
goto out_conf;
+ rc = -1;
+
for (filename = pxe_conf_files; *filename; filename++) {
url = pb_url_join(dc, conf_url, *filename);
if (!url)
OpenPOWER on IntegriCloud