- patches.arch/x86_mce_intel_decode_physical_address.patch:
[linux-flexiantxendom0-3.2.10.git] / drivers / staging / rtl8187se / ieee80211 / ieee80211_module.c
index 18392fc..9d58a42 100644 (file)
@@ -66,8 +66,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",
@@ -75,9 +75,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;
 }