Skip to contentSkip to conversation

wireless: fix build warning of used uninitialized variable

PATCH In review Wang Weidong 2 participants 2 messages Dec 6, 2013 1 message not in the archive

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

PATCH 1/1 wireless: fix build warning of used uninitialized variable

nl80211.c: In function __cfg80211_wdev_from_attrs nl80211.c:77: warning: wdev_id may be used uninitialized in this function

---
 net/wireless/nl80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/nl80211.c +1 -1
index 138dc3b..6894229 100644
@@ -74,7 +74,7 @@ __cfg80211_wdev_from_attrs(struct net *netns, struct nlattr **attrs)
 	struct wireless_dev *result = NULL;
 	bool have_ifidx = attrs[NL80211_ATTR_IFINDEX];
 	bool have_wdev_id = attrs[NL80211_ATTR_WDEV];
-	u64 wdev_id;
+	u64 wdev_id = 0;
 	int wiphy_idx = -1;
 	int ifidx = -1;
 
Signature · 1 line
1.6.0.2

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 3 lines · Wang Weidong

nl80211.c: In function __cfg80211_wdev_from_attrs nl80211.c:77: warning: wdev_id may be used uninitialized in this function

Sorry. My complier version is too low so that I got this warning. Just ignore it.

Regards.
Wang

Quoted 11 lines
---
 net/wireless/nl80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/nl80211.c +0 -0
index 138dc3b..6894229 100644

net/wireless/nl80211.c __cfg80211_wdev_from_attrs(struct net *netns, struct nlattr **attrs) · line 80

Quoted 8 lines
net/wireless/nl80211.c +1 -1
@@ -74,7 +74,7 @@ __cfg80211_wdev_from_attrs(struct net *netns, struct nlattr **attrs)
 	struct wireless_dev *result = NULL;
 	bool have_ifidx = attrs[NL80211_ATTR_IFINDEX];
 	bool have_wdev_id = attrs[NL80211_ATTR_WDEV];
-	u64 wdev_id;
+	u64 wdev_id = 0;
 	int wiphy_idx = -1;
 	int ifidx = -1;
 

--
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