All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org
Subject: [PATCH] mac80211: fix "warning: ‘target_metric’ may be used uninitialized"
Date: Mon, 4 Apr 2016 14:15:23 -0400	[thread overview]
Message-ID: <5702AF3B.1070507@suse.com> (raw)

This fixes:

net/mac80211/mesh_hwmp.c:603:26: warning: ‘target_metric’ may be used
uninitialized in this function

target_metric is only consumed when reply = true so no bug exists here,
but gcc doesn't notice that.  Initializing to 0 clears the warning.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---

 net/mac80211/mesh_hwmp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -530,7 +530,7 @@ static void hwmp_preq_frame_process(stru
 	const u8 *target_addr, *orig_addr;
 	const u8 *da;
 	u8 target_flags, ttl, flags;
-	u32 orig_sn, target_sn, lifetime, target_metric;
+	u32 orig_sn, target_sn, lifetime, target_metric = 0;
 	bool reply = false;
 	bool forward = true;
 	bool root_is_gate;

-- 
Jeff Mahoney
SUSE Labs

             reply	other threads:[~2016-04-04 18:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04 18:15 Jeff Mahoney [this message]
2016-04-05  9:43 ` [PATCH] mac80211: fix "warning: ‘target_metric’ may be used uninitialized" Johannes Berg
2016-04-05 13:33   ` Jeff Mahoney
2016-04-05 13:40     ` Johannes Berg
2016-04-05 13:47       ` Jeff Mahoney
2016-04-06 13:14 ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5702AF3B.1070507@suse.com \
    --to=jeffm@suse.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.