From: Johannes Berg There's no need to define 'profile_len' at the outer scope and initialize it, move it where needed and just return 0 if nothing can be found. Signed-off-by: Johannes Berg --- net/mac80211/parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/mac80211/parse.c b/net/mac80211/parse.c index 8b30e361b622..22365c507b99 100644 --- a/net/mac80211/parse.c +++ b/net/mac80211/parse.c @@ -813,10 +813,9 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, u8 *nontransmitted_profile) { const struct element *elem, *sub; - size_t profile_len = 0; if (!bss || !bss->transmitted_bss) - return profile_len; + return 0; for_each_element_id(elem, WLAN_EID_MULTIPLE_BSSID, start, len) { if (elem->datalen < 2) @@ -826,6 +825,7 @@ static size_t ieee802_11_find_bssid_profile(const u8 *start, size_t len, for_each_element(sub, elem->data + 1, elem->datalen - 1) { u8 new_bssid[ETH_ALEN]; + size_t profile_len; const u8 *index; if (sub->id != 0 || sub->datalen < 4) { -- 2.53.0