From: Navya Sri Nizamkari Date: Tue, 10 Mar 2015 12:25:40 +0000 (+0530) Subject: staging: wlan-ng: Use kzalloc instead of kmalloc. X-Git-Tag: firefly_0821_release~176^2~1998^2~138^2~459 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d0edf4bcfa67702e821acb8592bc9b33a328f13a;p=firefly-linux-kernel-4.4.55.git staging: wlan-ng: Use kzalloc instead of kmalloc. This patch uses kzalloc instead of kmalloc function. A coccinelle script was used to make this change. Signed-off-by: Navya Sri Nizamkari Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c b/drivers/staging/wlan-ng/hfa384x_usb.c index c85b1b55fdb3..e109a7fd422f 100644 --- a/drivers/staging/wlan-ng/hfa384x_usb.c +++ b/drivers/staging/wlan-ng/hfa384x_usb.c @@ -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; }