staging: rtl8192e: Use kzalloc instead of kmalloc.
authorNavya Sri Nizamkari <navyasri.tech@gmail.com>
Tue, 10 Mar 2015 12:28:07 +0000 (17:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Mar 2015 17:41:09 +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/rtl8192e/rtllib_softmac.c

index 16aef7cf23b94a557eb06e3931ced3b1eb6c0269..c246ef40c69e15fceca5713c7c7fdf6876d532c0 100644 (file)
@@ -3421,12 +3421,11 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
 
                lib80211_crypt_delayed_deinit(&ieee->crypt_info, crypt);
 
-               new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
+               new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
                if (new_crypt == NULL) {
                        ret = -ENOMEM;
                        goto done;
                }
-               memset(new_crypt, 0, sizeof(struct lib80211_crypt_data));
                new_crypt->ops = ops;
                if (new_crypt->ops)
                        new_crypt->priv =