diff options
author | Yan Burman <burman.yan@gmail.com> | 2006-12-02 06:35:20 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-12-05 19:31:32 -0500 |
commit | b950e83b69a69f3db5ae64ab70b336886855517f (patch) | |
tree | 8ff1fa847f3cca3340b5a6188a54983a56fd0d5b /drivers/net/wireless/prism54 | |
parent | b0471bb7b779f5deea109e5bfdfe8c18d4a06241 (diff) |
[PATCH] prism54: replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc
Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/prism54')
-rw-r--r-- | drivers/net/wireless/prism54/isl_ioctl.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/prism54/oid_mgt.c | 4 |
2 files changed, 4 insertions, 9 deletions
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 4a20e45de3ca..a48edd131d75 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -2140,11 +2140,9 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid, | |||
2140 | struct islpci_bss_wpa_ie, list); | 2140 | struct islpci_bss_wpa_ie, list); |
2141 | list_del(&bss->list); | 2141 | list_del(&bss->list); |
2142 | } else { | 2142 | } else { |
2143 | bss = kmalloc(sizeof (*bss), GFP_ATOMIC); | 2143 | bss = kzalloc(sizeof (*bss), GFP_ATOMIC); |
2144 | if (bss != NULL) { | 2144 | if (bss != NULL) |
2145 | priv->num_bss_wpa++; | 2145 | priv->num_bss_wpa++; |
2146 | memset(bss, 0, sizeof (*bss)); | ||
2147 | } | ||
2148 | } | 2146 | } |
2149 | if (bss != NULL) { | 2147 | if (bss != NULL) { |
2150 | memcpy(bss->bssid, bssid, ETH_ALEN); | 2148 | memcpy(bss->bssid, bssid, ETH_ALEN); |
@@ -2684,11 +2682,10 @@ prism2_ioctl_set_generic_element(struct net_device *ndev, | |||
2684 | return -EINVAL; | 2682 | return -EINVAL; |
2685 | 2683 | ||
2686 | alen = sizeof(*attach) + len; | 2684 | alen = sizeof(*attach) + len; |
2687 | attach = kmalloc(alen, GFP_KERNEL); | 2685 | attach = kzalloc(alen, GFP_KERNEL); |
2688 | if (attach == NULL) | 2686 | if (attach == NULL) |
2689 | return -ENOMEM; | 2687 | return -ENOMEM; |
2690 | 2688 | ||
2691 | memset(attach, 0, alen); | ||
2692 | #define WLAN_FC_TYPE_MGMT 0 | 2689 | #define WLAN_FC_TYPE_MGMT 0 |
2693 | #define WLAN_FC_STYPE_ASSOC_REQ 0 | 2690 | #define WLAN_FC_STYPE_ASSOC_REQ 0 |
2694 | #define WLAN_FC_STYPE_REASSOC_REQ 2 | 2691 | #define WLAN_FC_STYPE_REASSOC_REQ 2 |
diff --git a/drivers/net/wireless/prism54/oid_mgt.c b/drivers/net/wireless/prism54/oid_mgt.c index fbc52b6a3024..e6cf9df2c206 100644 --- a/drivers/net/wireless/prism54/oid_mgt.c +++ b/drivers/net/wireless/prism54/oid_mgt.c | |||
@@ -235,12 +235,10 @@ mgt_init(islpci_private *priv) | |||
235 | { | 235 | { |
236 | int i; | 236 | int i; |
237 | 237 | ||
238 | priv->mib = kmalloc(OID_NUM_LAST * sizeof (void *), GFP_KERNEL); | 238 | priv->mib = kcalloc(OID_NUM_LAST, sizeof (void *), GFP_KERNEL); |
239 | if (!priv->mib) | 239 | if (!priv->mib) |
240 | return -ENOMEM; | 240 | return -ENOMEM; |
241 | 241 | ||
242 | memset(priv->mib, 0, OID_NUM_LAST * sizeof (void *)); | ||
243 | |||
244 | /* Alloc the cache */ | 242 | /* Alloc the cache */ |
245 | for (i = 0; i < OID_NUM_LAST; i++) { | 243 | for (i = 0; i < OID_NUM_LAST; i++) { |
246 | if (isl_oid[i].flags & OID_FLAG_CACHED) { | 244 | if (isl_oid[i].flags & OID_FLAG_CACHED) { |