Search Linux Wireless

Re: [PATCH] mac80211: fix warning in ieee80211_probe_client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2011-11-11 at 13:32 -0500, John W. Linville wrote:
> CC [M]  net/mac80211/cfg.o
> net/mac80211/cfg.c: In function ‘ieee80211_probe_client’:
> net/mac80211/cfg.c:2567:7: warning: ‘qos’ may be used uninitialized in this function

Hm, you need a better compiler ;-) How about below instead (keeping the
subject)? I kinda don't like just initialising the variable "randomly".

johannes


From: Johannes Berg <johannes.berg@xxxxxxxxx>

The warning is spurious -- if !sta we always exit without using the
unassigned qos variable, and if we do find the sta we assign it.

Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
---

--- wireless-testing.orig/net/mac80211/cfg.c	2011-11-10 09:29:29.000000000 +0100
+++ wireless-testing/net/mac80211/cfg.c	2011-11-11 20:21:08.000000000 +0100
@@ -2530,12 +2530,13 @@ static int ieee80211_probe_client(struct
 
 	rcu_read_lock();
 	sta = sta_info_get(sdata, peer);
-	if (sta)
+	if (sta) {
 		qos = test_sta_flag(sta, WLAN_STA_WME);
-	rcu_read_unlock();
-
-	if (!sta)
+		rcu_read_unlock();
+	} else {
+		rcu_read_unlock();
 		return -ENOLINK;
+	}
 
 	if (qos) {
 		fc = cpu_to_le16(IEEE80211_FTYPE_DATA |


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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux