]> err.no Git - linux-2.6/commitdiff
[PATCH] prism54: replace kmalloc+memset with kzalloc
authorYan Burman <burman.yan@gmail.com>
Sat, 2 Dec 2006 11:35:20 +0000 (13:35 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 6 Dec 2006 00:31:32 +0000 (19:31 -0500)
Replace kmalloc+memset with kzalloc

Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/prism54/isl_ioctl.c
drivers/net/wireless/prism54/oid_mgt.c

index 4a20e45de3cab20caced617449070d994fa5272e..a48edd131d7583f47b322c0a772933fe425139ba 100644 (file)
@@ -2140,11 +2140,9 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
                                         struct islpci_bss_wpa_ie, list);
                        list_del(&bss->list);
                } else {
-                       bss = kmalloc(sizeof (*bss), GFP_ATOMIC);
-                       if (bss != NULL) {
+                       bss = kzalloc(sizeof (*bss), GFP_ATOMIC);
+                       if (bss != NULL)
                                priv->num_bss_wpa++;
-                               memset(bss, 0, sizeof (*bss));
-                       }
                }
                if (bss != NULL) {
                        memcpy(bss->bssid, bssid, ETH_ALEN);
@@ -2684,11 +2682,10 @@ prism2_ioctl_set_generic_element(struct net_device *ndev,
                return -EINVAL;
 
        alen = sizeof(*attach) + len;
-       attach = kmalloc(alen, GFP_KERNEL);
+       attach = kzalloc(alen, GFP_KERNEL);
        if (attach == NULL)
                return -ENOMEM;
 
-       memset(attach, 0, alen);
 #define WLAN_FC_TYPE_MGMT 0
 #define WLAN_FC_STYPE_ASSOC_REQ 0
 #define WLAN_FC_STYPE_REASSOC_REQ 2
index fbc52b6a30247f100d500daed5add811248de452..e6cf9df2c20655699618bd3f18595a99862772e3 100644 (file)
@@ -235,12 +235,10 @@ mgt_init(islpci_private *priv)
 {
        int i;
 
-       priv->mib = kmalloc(OID_NUM_LAST * sizeof (void *), GFP_KERNEL);
+       priv->mib = kcalloc(OID_NUM_LAST, sizeof (void *), GFP_KERNEL);
        if (!priv->mib)
                return -ENOMEM;
 
-       memset(priv->mib, 0, OID_NUM_LAST * sizeof (void *));
-
        /* Alloc the cache */
        for (i = 0; i < OID_NUM_LAST; i++) {
                if (isl_oid[i].flags & OID_FLAG_CACHED) {