Merge branch 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32
[powerpc.git] / net / ieee80211 / ieee80211_wx.c
index a78c4f8..cee5e13 100644 (file)
@@ -5,8 +5,8 @@
   Portions of this file are based on the WEP enablement code provided by the
   Host AP project hostap-drivers v0.1.3
   Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
-  <jkmaline@cc.hut.fi>
-  Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
+  <j@w1.fi>
+  Copyright (c) 2002-2003, Jouni Malinen <j@w1.fi>
 
   This program is free software; you can redistribute it and/or modify it
   under the terms of version 2 of the GNU General Public License as
@@ -369,11 +369,10 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
                struct ieee80211_crypt_data *new_crypt;
 
                /* take WEP into use */
-               new_crypt = kmalloc(sizeof(struct ieee80211_crypt_data),
+               new_crypt = kzalloc(sizeof(struct ieee80211_crypt_data),
                                    GFP_KERNEL);
                if (new_crypt == NULL)
                        return -ENOMEM;
-               memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
                new_crypt->ops = ieee80211_get_crypto_ops("WEP");
                if (!new_crypt->ops) {
                        request_module("ieee80211_crypt_wep");
@@ -616,13 +615,11 @@ int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
 
                ieee80211_crypt_delayed_deinit(ieee, crypt);
 
-               new_crypt = (struct ieee80211_crypt_data *)
-                   kmalloc(sizeof(*new_crypt), GFP_KERNEL);
+               new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
                if (new_crypt == NULL) {
                        ret = -ENOMEM;
                        goto done;
                }
-               memset(new_crypt, 0, sizeof(struct ieee80211_crypt_data));
                new_crypt->ops = ops;
                if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
                        new_crypt->priv = new_crypt->ops->init(idx);
@@ -757,7 +754,7 @@ int ieee80211_wx_set_auth(struct net_device *dev,
        int err = 0;
 
        spin_lock_irqsave(&ieee->lock, flags);
-       
+
        switch (wrqu->param.flags & IW_AUTH_INDEX) {
        case IW_AUTH_WPA_VERSION:
        case IW_AUTH_CIPHER_PAIRWISE:
@@ -802,7 +799,7 @@ int ieee80211_wx_get_auth(struct net_device *dev,
        int err = 0;
 
        spin_lock_irqsave(&ieee->lock, flags);
-       
+
        switch (wrqu->param.flags & IW_AUTH_INDEX) {
        case IW_AUTH_WPA_VERSION:
        case IW_AUTH_CIPHER_PAIRWISE: