diff options
author | Thomas Meyer | 2011-11-10 19:04:19 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2011-11-27 02:21:16 +0100 |
commit | 929fa2a42e75e0c6ded89c450bd0f668e32190d7 (patch) | |
tree | b1d014bd37af15efe216af3c2242c46541e1758c /drivers/staging/rtl8192e/rtllib_softmac.c | |
parent | rtl8192e: drop alternate code paths for CONFIG_PM_RTL (diff) | |
download | kernel-qcow2-linux-929fa2a42e75e0c6ded89c450bd0f668e32190d7.tar.gz kernel-qcow2-linux-929fa2a42e75e0c6ded89c450bd0f668e32190d7.tar.xz kernel-qcow2-linux-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_softmac.c')
-rw-r--r-- | drivers/staging/rtl8192e/rtllib_softmac.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c index fa774cf7fc78..30c3bca1c368 100644 --- a/drivers/staging/rtl8192e/rtllib_softmac.c +++ b/drivers/staging/rtl8192e/rtllib_softmac.c @@ -3048,10 +3048,9 @@ void rtllib_softmac_init(struct rtllib_device *ieee) ieee->state = RTLLIB_NOLINK; for (i = 0; i < 5; i++) ieee->seq_ctrl[i] = 0; - ieee->pDot11dInfo = kmalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); + ieee->pDot11dInfo = kzalloc(sizeof(struct rt_dot11d_info), GFP_ATOMIC); if (!ieee->pDot11dInfo) RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc memory for DOT11D\n"); - memset(ieee->pDot11dInfo, 0, sizeof(struct rt_dot11d_info)); ieee->LinkDetectInfo.SlotIndex = 0; ieee->LinkDetectInfo.SlotNum = 2; ieee->LinkDetectInfo.NumRecvBcnInPeriod = 0; |