From: Jeff Mahoney Date: Mon, 4 Apr 2016 18:15:23 +0000 (-0400) Subject: mac80211: fix "warning: ‘target_metric’ may be used uninitialized" X-Git-Tag: MMI-PSA29.97-13-9~8154^2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b4201cc4fc6e1c57d6d306b1f787865043d60129;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git mac80211: fix "warning: ‘target_metric’ may be used uninitialized" 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 not all versions of gcc realize it. Initialize to 0 to remove the warning. Signed-off-by: Jeff Mahoney Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 5b6aec1a0630..002244bca948 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -530,7 +530,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, 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;