Skip to content

Commit b4201cc

Browse files
jeffmahoneyjmberg-intel
authored andcommitted
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 <jeffm@suse.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent f6d4671 commit b4201cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/mac80211/mesh_hwmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
530530
const u8 *target_addr, *orig_addr;
531531
const u8 *da;
532532
u8 target_flags, ttl, flags;
533-
u32 orig_sn, target_sn, lifetime, target_metric;
533+
u32 orig_sn, target_sn, lifetime, target_metric = 0;
534534
bool reply = false;
535535
bool forward = true;
536536
bool root_is_gate;

0 commit comments

Comments
 (0)