staging/wlan-ng: use kzalloc rather using kmalloc at create_wlan
[firefly-linux-kernel-4.4.55.git] / drivers / staging / wlan-ng / prism2sta.c
index 417aea5e01cd6b08fac4f235b8443d55678d6e9b..1dfd9aa5e9fe8af80cfb085c7921774a594922f3 100644 (file)
@@ -1947,8 +1947,8 @@ static wlandevice_t *create_wlan(void)
        hfa384x_t *hw = NULL;
 
        /* Alloc our structures */
-       wlandev = kmalloc(sizeof(wlandevice_t), GFP_KERNEL);
-       hw = kmalloc(sizeof(hfa384x_t), GFP_KERNEL);
+       wlandev = kzalloc(sizeof(wlandevice_t), GFP_KERNEL);
+       hw = kzalloc(sizeof(hfa384x_t), GFP_KERNEL);
 
        if (!wlandev || !hw) {
                printk(KERN_ERR "%s: Memory allocation failure.\n", dev_info);
@@ -1957,10 +1957,6 @@ static wlandevice_t *create_wlan(void)
                return NULL;
        }
 
-       /* Clear all the structs */
-       memset(wlandev, 0, sizeof(wlandevice_t));
-       memset(hw, 0, sizeof(hfa384x_t));
-
        /* Initialize the network device object. */
        wlandev->nsdname = dev_info;
        wlandev->msdstate = WLAN_MSD_HWPRESENT_PENDING;