Skip to contentSkip to conversation

nl80211.c: Fixed the wdev_id being used uninitialized.

PATCH In review Shakil A Khan 2 participants 4 messages Sep 1, 2014

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

PATCH 2/2 nl80211.c: Fixed the wdev_id being used uninitialized.

---
 net/wireless/nl80211.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/wireless/nl80211.c +1 -1
index df7b133..6cd7df2 100644
@@ -76,7 +76,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.7.1
maintainer
#1 lore raw

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

Quoted 2 lines
net/wireless/nl80211.c +1 -0
+	u64 wdev_id = 0;

it's not used uninitialized, NACK.

johannes

#2 lore raw
Quoted 6 lines · On Monday 01 September 2014 08:07:38 Johannes Berg wrote:

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

Quoted 1 line
net/wireless/nl80211.c +1 -0
+	u64 wdev_id = 0;

it's not used uninitialized, NACK.

johannes

wdev_id can be used uninitialized if have_wdev_id turns to be false, which may happen if the entry for NL80211_ATTR_WDEV is removed in future. Who knows.

maintainer
#3 lore raw
Quoted 11 lines · Shakil A Khan
Quoted 6 lines · On Monday 01 September 2014 08:07:38 Johannes Berg wrote:

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

Quoted 1 line
net/wireless/nl80211.c +1 -0
+	u64 wdev_id = 0;

it's not used uninitialized, NACK.

johannes

wdev_id can be used uninitialized if have_wdev_id turns to be false, which may happen if the entry for NL80211_ATTR_WDEV is removed in future. Who knows.

In which case the compiler will warn about it. If you were to use a newer compiler now, you wouldn't see the warning.

johannes