linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: fix "warning: ‘target_metric’ may be used uninitialized"
@ 2016-04-04 18:15 Jeff Mahoney
  2016-04-05  9:43 ` Johannes Berg
  2016-04-06 13:14 ` Johannes Berg
  0 siblings, 2 replies; 6+ messages in thread
From: Jeff Mahoney @ 2016-04-04 18:15 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-06 13:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-04 18:15 [PATCH] mac80211: fix "warning: ‘target_metric’ may be used uninitialized" Jeff Mahoney
2016-04-05  9:43 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).