nl80211.c: Fixed the wdev_id being used uninitialized.
Subsystems (3)
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
@@ -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
Johannes Berg
maintainernet/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
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.
Johannes Berg
maintainerQuoted 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_idcan be used uninitialized ifhave_wdev_idturns to be false, which may happen if the entry forNL80211_ATTR_WDEVis 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