staging: wlan-ng: Use kzalloc instead of kmalloc.
authorNavya Sri Nizamkari <navyasri.tech@gmail.com>
Tue, 10 Mar 2015 12:25:40 +0000 (17:55 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Mar 2015 17:41:10 +0000 (18:41 +0100)
This patch uses kzalloc instead of kmalloc function.
A coccinelle script was used to make this change.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wlan-ng/hfa384x_usb.c

index c85b1b55fdb33a9f6b2d8b8272a3d735836ee280..e109a7fd422ffe387f0457c695eb39518472d956 100644 (file)
@@ -619,11 +619,10 @@ static hfa384x_usbctlx_t *usbctlx_alloc(void)
 {
        hfa384x_usbctlx_t *ctlx;
 
-       ctlx = kmalloc(sizeof(*ctlx), in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
-       if (ctlx != NULL) {
-               memset(ctlx, 0, sizeof(*ctlx));
+       ctlx = kzalloc(sizeof(*ctlx),
+                      in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
+       if (ctlx != NULL)
                init_completion(&ctlx->done);
-       }
 
        return ctlx;
 }