From: Navya Sri Nizamkari Date: Tue, 10 Mar 2015 12:26:58 +0000 (+0530) Subject: staging: rtl8192u: Use kzalloc instead of kmalloc. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a774fe09237adc329c9fda5ec877dccebfd2589e;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git staging: rtl8192u: 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/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 878086af9445..d93e5fd4c46e 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -3025,12 +3025,11 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ieee80211_crypt_delayed_deinit(ieee, 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 ieee80211_crypt_data)); new_crypt->ops = ops; if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) new_crypt->priv =