diff options
author | Johannes Berg <johannes.berg@intel.com> | 2018-04-20 06:49:22 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-05-07 14:49:59 -0400 |
commit | bfb27814e3d89a6abf362542bc4b26d84debc5b6 (patch) | |
tree | bbf8dfcc2d580e9b0be71eba8023633ecc2ecf96 /net/mac80211/ethtool.c | |
parent | 35f4962c01757db6cc1dcdf5526ec6e5afcb6245 (diff) |
mac80211: ethtool: memset the whole sinfo struct to 0
Rather than just setting the valid flags to 0 set the
whole struct to 0 since other places might rely on it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ethtool.c')
-rw-r--r-- | net/mac80211/ethtool.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c index 9cc986deda61..08408520c3f8 100644 --- a/net/mac80211/ethtool.c +++ b/net/mac80211/ethtool.c | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copied from cfg.c - originally | 4 | * Copied from cfg.c - originally |
5 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> | 5 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
6 | * Copyright 2014 Intel Corporation (Author: Johannes Berg) | 6 | * Copyright 2014 Intel Corporation (Author: Johannes Berg) |
7 | * Copyright (C) 2018 Intel Corporation | ||
7 | * | 8 | * |
8 | * This file is GPLv2 as found in COPYING. | 9 | * This file is GPLv2 as found in COPYING. |
9 | */ | 10 | */ |
@@ -106,7 +107,7 @@ static void ieee80211_get_stats(struct net_device *dev, | |||
106 | if (!(sta && !WARN_ON(sta->sdata->dev != dev))) | 107 | if (!(sta && !WARN_ON(sta->sdata->dev != dev))) |
107 | goto do_survey; | 108 | goto do_survey; |
108 | 109 | ||
109 | sinfo.filled = 0; | 110 | memset(&sinfo, 0, sizeof(sinfo)); |
110 | sta_set_sinfo(sta, &sinfo); | 111 | sta_set_sinfo(sta, &sinfo); |
111 | 112 | ||
112 | i = 0; | 113 | i = 0; |
@@ -133,7 +134,7 @@ static void ieee80211_get_stats(struct net_device *dev, | |||
133 | if (sta->sdata->dev != dev) | 134 | if (sta->sdata->dev != dev) |
134 | continue; | 135 | continue; |
135 | 136 | ||
136 | sinfo.filled = 0; | 137 | memset(&sinfo, 0, sizeof(sinfo)); |
137 | sta_set_sinfo(sta, &sinfo); | 138 | sta_set_sinfo(sta, &sinfo); |
138 | i = 0; | 139 | i = 0; |
139 | ADD_STA_STATS(sta); | 140 | ADD_STA_STATS(sta); |