Skip to content

Commit

Permalink
mac80211: fix "warning: ‘target_metric’ may be used uninitialized"
Browse files Browse the repository at this point in the history
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 <jeffm@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
jeffmahoney authored and jmberg-intel committed Apr 6, 2016
1 parent f6d4671 commit b4201cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac80211/mesh_hwmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b4201cc

Please sign in to comment.