diff options
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/ieee80211_rate.c | 3 | ||||
-rw-r--r-- | net/mac80211/ieee80211_sta.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/net/mac80211/ieee80211_rate.c b/net/mac80211/ieee80211_rate.c index 16e850864b8a..2118de04fc35 100644 --- a/net/mac80211/ieee80211_rate.c +++ b/net/mac80211/ieee80211_rate.c | |||
@@ -24,11 +24,10 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops) | |||
24 | { | 24 | { |
25 | struct rate_control_alg *alg; | 25 | struct rate_control_alg *alg; |
26 | 26 | ||
27 | alg = kmalloc(sizeof(*alg), GFP_KERNEL); | 27 | alg = kzalloc(sizeof(*alg), GFP_KERNEL); |
28 | if (alg == NULL) { | 28 | if (alg == NULL) { |
29 | return -ENOMEM; | 29 | return -ENOMEM; |
30 | } | 30 | } |
31 | memset(alg, 0, sizeof(*alg)); | ||
32 | alg->ops = ops; | 31 | alg->ops = ops; |
33 | 32 | ||
34 | mutex_lock(&rate_ctrl_mutex); | 33 | mutex_lock(&rate_ctrl_mutex); |
diff --git a/net/mac80211/ieee80211_sta.c b/net/mac80211/ieee80211_sta.c index ba2bf8f0a347..22b11786327a 100644 --- a/net/mac80211/ieee80211_sta.c +++ b/net/mac80211/ieee80211_sta.c | |||
@@ -1327,10 +1327,9 @@ ieee80211_rx_bss_add(struct net_device *dev, u8 *bssid) | |||
1327 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | 1327 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); |
1328 | struct ieee80211_sta_bss *bss; | 1328 | struct ieee80211_sta_bss *bss; |
1329 | 1329 | ||
1330 | bss = kmalloc(sizeof(*bss), GFP_ATOMIC); | 1330 | bss = kzalloc(sizeof(*bss), GFP_ATOMIC); |
1331 | if (!bss) | 1331 | if (!bss) |
1332 | return NULL; | 1332 | return NULL; |
1333 | memset(bss, 0, sizeof(*bss)); | ||
1334 | atomic_inc(&bss->users); | 1333 | atomic_inc(&bss->users); |
1335 | atomic_inc(&bss->users); | 1334 | atomic_inc(&bss->users); |
1336 | memcpy(bss->bssid, bssid, ETH_ALEN); | 1335 | memcpy(bss->bssid, bssid, ETH_ALEN); |