Skip to contentSkip to conversation

mac80211: fix build warning

PATCH In review Alexandre Pereira da Silva 2 participants 3 messages Jun 25, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: fix build warning

Fix:
net/mac80211/mlme.c: In function 'ieee80211_prep_connection':
net/mac80211/mlme.c:3035:19: warning: 'sta' may be used uninitialized in this function

Initialize sta to NULL

---
 net/mac80211/mlme.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mlme.c +1 -1
index 91d84cc..cfe6b43 100644
@@ -3032,7 +3032,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
 	struct ieee80211_bss *bss = (void *)cbss->priv;
-	struct sta_info *sta;
+	struct sta_info *sta = NULL;
 	bool have_sta = false;
 	int err;
 	int ht_cfreq;
Signature · 1 line
1.7.10
#1 lore raw

Hi,

Quoted 6 lines · Alexandre Pereira da Silva

Fix:
net/mac80211/mlme.c: In function 'ieee80211_prep_connection':
net/mac80211/mlme.c:3035:19: warning: 'sta' may be used uninitialized in this function

Initialize sta to NULL

i think already fixed by and there in wireless-testing
http://www.spinics.net/lists/linux-wireless/msg92385.html

Quoted 26 lines

---
 net/mac80211/mlme.c |    2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/mlme.c +1 -2
index 91d84cc..cfe6b43 100644
@@ -3032,7 +3032,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata,
        struct ieee80211_local *local = sdata->local;
        struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
        struct ieee80211_bss *bss = (void *)cbss->priv;
-       struct sta_info *sta;
+       struct sta_info *sta = NULL;
        bool have_sta = false;
        int err;
        int ht_cfreq;
--

1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
thanks,
shafi
#2 lore raw
Quoted 9 lines · Mohammed Shafi

Hi,

Quoted 5 lines · Alexandre Pereira da Silva

Fix:
net/mac80211/mlme.c: In function 'ieee80211_prep_connection':
net/mac80211/mlme.c:3035:19: warning: 'sta' may be used uninitialized in this function

Quoted 4 lines
Quoted 1 line

Initialize sta to NULL

i think already fixed by and there in wireless-testing
http://www.spinics.net/lists/linux-wireless/msg92385.html

Ok, thanks for pointing that out.