diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 17:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:51:30 -0400 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/ieee80211 | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff) |
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee80211')
-rw-r--r-- | net/ieee80211/ieee80211_crypt.c | 3 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_crypt_ccmp.c | 3 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_crypt_wep.c | 3 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_wx.c | 7 | ||||
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_io.c | 3 |
5 files changed, 6 insertions, 13 deletions
diff --git a/net/ieee80211/ieee80211_crypt.c b/net/ieee80211/ieee80211_crypt.c index cb71d794a7d1..5ed0a98b2d76 100644 --- a/net/ieee80211/ieee80211_crypt.c +++ b/net/ieee80211/ieee80211_crypt.c | |||
@@ -110,11 +110,10 @@ int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops) | |||
110 | unsigned long flags; | 110 | unsigned long flags; |
111 | struct ieee80211_crypto_alg *alg; | 111 | struct ieee80211_crypto_alg *alg; |
112 | 112 | ||
113 | alg = kmalloc(sizeof(*alg), GFP_KERNEL); | 113 | alg = kzalloc(sizeof(*alg), GFP_KERNEL); |
114 | if (alg == NULL) | 114 | if (alg == NULL) |
115 | return -ENOMEM; | 115 | return -ENOMEM; |
116 | 116 | ||
117 | memset(alg, 0, sizeof(*alg)); | ||
118 | alg->ops = ops; | 117 | alg->ops = ops; |
119 | 118 | ||
120 | spin_lock_irqsave(&ieee80211_crypto_lock, flags); | 119 | spin_lock_irqsave(&ieee80211_crypto_lock, flags); |
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c index 492647382ad0..ed90a8af1444 100644 --- a/net/ieee80211/ieee80211_crypt_ccmp.c +++ b/net/ieee80211/ieee80211_crypt_ccmp.c | |||
@@ -76,10 +76,9 @@ static void *ieee80211_ccmp_init(int key_idx) | |||
76 | { | 76 | { |
77 | struct ieee80211_ccmp_data *priv; | 77 | struct ieee80211_ccmp_data *priv; |
78 | 78 | ||
79 | priv = kmalloc(sizeof(*priv), GFP_ATOMIC); | 79 | priv = kzalloc(sizeof(*priv), GFP_ATOMIC); |
80 | if (priv == NULL) | 80 | if (priv == NULL) |
81 | goto fail; | 81 | goto fail; |
82 | memset(priv, 0, sizeof(*priv)); | ||
83 | priv->key_idx = key_idx; | 82 | priv->key_idx = key_idx; |
84 | 83 | ||
85 | priv->tfm = crypto_alloc_tfm("aes", 0); | 84 | priv->tfm = crypto_alloc_tfm("aes", 0); |
diff --git a/net/ieee80211/ieee80211_crypt_wep.c b/net/ieee80211/ieee80211_crypt_wep.c index c5a87724aabe..0ebf235f6939 100644 --- a/net/ieee80211/ieee80211_crypt_wep.c +++ b/net/ieee80211/ieee80211_crypt_wep.c | |||
@@ -39,10 +39,9 @@ static void *prism2_wep_init(int keyidx) | |||
39 | { | 39 | { |
40 | struct prism2_wep_data *priv; | 40 | struct prism2_wep_data *priv; |
41 | 41 | ||
42 | priv = kmalloc(sizeof(*priv), GFP_ATOMIC); | 42 | priv = kzalloc(sizeof(*priv), GFP_ATOMIC); |
43 | if (priv == NULL) | 43 | if (priv == NULL) |
44 | goto fail; | 44 | goto fail; |
45 | memset(priv, 0, sizeof(*priv)); | ||
46 | priv->key_idx = keyidx; | 45 | priv->key_idx = keyidx; |
47 | 46 | ||
48 | priv->tfm = crypto_alloc_tfm("arc4", 0); | 47 | priv->tfm = crypto_alloc_tfm("arc4", 0); |
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); |
diff --git a/net/ieee80211/softmac/ieee80211softmac_io.c b/net/ieee80211/softmac/ieee80211softmac_io.c index 8cc8b20f5cda..6ae5a1dc7956 100644 --- a/net/ieee80211/softmac/ieee80211softmac_io.c +++ b/net/ieee80211/softmac/ieee80211softmac_io.c | |||
@@ -96,8 +96,7 @@ ieee80211softmac_alloc_mgt(u32 size) | |||
96 | if(size > IEEE80211_DATA_LEN) | 96 | if(size > IEEE80211_DATA_LEN) |
97 | return NULL; | 97 | return NULL; |
98 | /* Allocate the frame */ | 98 | /* Allocate the frame */ |
99 | data = kmalloc(size, GFP_ATOMIC); | 99 | data = kzalloc(size, GFP_ATOMIC); |
100 | memset(data, 0, size); | ||
101 | return data; | 100 | return data; |
102 | } | 101 | } |
103 | 102 | ||