diff options
Diffstat (limited to 'net/ieee80211/ieee80211_wx.c')
-rw-r--r-- | net/ieee80211/ieee80211_wx.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c index a78c4f845f66..5cb9cfd35397 100644 --- a/net/ieee80211/ieee80211_wx.c +++ b/net/ieee80211/ieee80211_wx.c | |||
@@ -369,11 +369,10 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, | |||
369 | struct ieee80211_crypt_data *new_crypt; | 369 | struct ieee80211_crypt_data *new_crypt; |
370 | 370 | ||
371 | /* take WEP into use */ | 371 | /* take WEP into use */ |
372 | new_crypt = kmalloc(sizeof(struct ieee80211_crypt_data), | 372 | new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data), |
373 | GFP_KERNEL); | 373 | GFP_KERNEL); |
374 | if (new_crypt == NULL) | 374 | if (new_crypt == NULL) |
375 | return -ENOMEM; | 375 | return -ENOMEM; |
376 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | ||
377 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); | 376 | new_crypt->ops = ieee80211_get_crypto_ops("WEP"); |
378 | if (!new_crypt->ops) { | 377 | if (!new_crypt->ops) { |
379 | request_module("ieee80211_crypt_wep"); | 378 | request_module("ieee80211_crypt_wep"); |
@@ -616,13 +615,11 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee, | |||
616 | 615 | ||
617 | ieee80211_crypt_delayed_deinit(ieee, crypt); | 616 | ieee80211_crypt_delayed_deinit(ieee, crypt); |
618 | 617 | ||
619 | new_crypt = (struct ieee80211_crypt_data *) | 618 | new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); |
620 | kmalloc(sizeof(*new_crypt), GFP_KERNEL); | ||
621 | if (new_crypt == NULL) { | 619 | if (new_crypt == NULL) { |
622 | ret = -ENOMEM; | 620 | ret = -ENOMEM; |
623 | goto done; | 621 | goto done; |
624 | } | 622 | } |
625 | memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data)); | ||
626 | new_crypt->ops = ops; | 623 | new_crypt->ops = ops; |
627 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) | 624 | if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) |
628 | new_crypt->priv = new_crypt->ops->init(idx); | 625 | new_crypt->priv = new_crypt->ops->init(idx); |