]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/staging/rtl8192e/ieee80211/ieee80211_module.c
Staging: Use kcalloc or kzalloc
[net-next-2.6.git] / drivers / staging / rtl8192e / ieee80211 / ieee80211_module.c
index c7aa1c63cb196ebe4362d3d6175a3d7f3be87562..614a8b630e67b4b14700873c5f0c3e9678582ea0 100644 (file)
@@ -65,8 +65,8 @@ static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee)
        if (ieee->networks)
                return 0;
 
-       ieee->networks = kmalloc(
-               MAX_NETWORK_COUNT * sizeof(struct ieee80211_network),
+       ieee->networks = kcalloc(
+               MAX_NETWORK_COUNT, sizeof(struct ieee80211_network),
                GFP_KERNEL);
        if (!ieee->networks) {
                printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
@@ -74,9 +74,6 @@ static inline int ieee80211_networks_allocate(struct ieee80211_device *ieee)
                return -ENOMEM;
        }
 
-       memset(ieee->networks, 0,
-              MAX_NETWORK_COUNT * sizeof(struct ieee80211_network));
-
        return 0;
 }