aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192e/rtllib_wx.c
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-11-10 19:04:19 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-26 17:21:16 -0800
commit929fa2a42e75e0c6ded89c450bd0f668e32190d7 (patch)
treeb1d014bd37af15efe216af3c2242c46541e1758c /drivers/staging/rtl8192e/rtllib_wx.c
parentrtl8192e: drop alternate code paths for CONFIG_PM_RTL (diff)
downloadlinux-dev-929fa2a42e75e0c6ded89c450bd0f668e32190d7.tar.xz
linux-dev-929fa2a42e75e0c6ded89c450bd0f668e32190d7.zip
staging: rtl8192e: Use kzalloc rather than kmalloc v2
Use kzalloc rather than kmalloc followed by memset with 0 This considers some simple cases that are common and easy to validate Note in particular that there are no ...s in the rule, so all of the matched code has to be contiguous The semantic patch that makes this change is available in scripts/coccinelle/api/alloc/kzalloc-simple.cocci. Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8192e/rtllib_wx.c')
-rw-r--r--drivers/staging/rtl8192e/rtllib_wx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index 8cea4a60e1b3..a8fd2e1f4ada 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -368,11 +368,10 @@ int rtllib_wx_set_encode(struct rtllib_device *ieee,
struct rtllib_crypt_data *new_crypt;
/* take WEP into use */
- new_crypt = kmalloc(sizeof(struct rtllib_crypt_data),
+ new_crypt = kzalloc(sizeof(struct rtllib_crypt_data),
GFP_KERNEL);
if (new_crypt == NULL)
return -ENOMEM;
- memset(new_crypt, 0, sizeof(struct rtllib_crypt_data));
new_crypt->ops = rtllib_get_crypto_ops("WEP");
if (!new_crypt->ops) {
request_module("rtllib_crypt_wep");