aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-13 22:00:05 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-14 14:02:56 -0700
commit7a6cb0d5497418599d2125b670926b75e673861c (patch)
treea698dc86695304ef6aefe4bc6d18fdad7f3770ee /drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
parentStaging: udlfb: fix coding style issues (diff)
downloadlinux-dev-7a6cb0d5497418599d2125b670926b75e673861c.tar.xz
linux-dev-7a6cb0d5497418599d2125b670926b75e673861c.zip
Staging: Use kcalloc or kzalloc
Use kcalloc or kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,y,flags; statement S; type T; @@ x = - kmalloc + kcalloc ( - y * sizeof(T), + y, sizeof(T), flags); if (x == NULL) S -memset(x, 0, y * sizeof(T)); @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset(x, 0, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk>
Diffstat (limited to 'drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c')
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
index 660aee2874a4..b9fa15fccb78 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
@@ -2699,10 +2699,9 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
for(i = 0; i < 5; i++) {
ieee->seq_ctrl[i] = 0;
}
- ieee->pDot11dInfo = kmalloc(sizeof(RT_DOT11D_INFO), GFP_ATOMIC);
+ ieee->pDot11dInfo = kzalloc(sizeof(RT_DOT11D_INFO), GFP_ATOMIC);
if (!ieee->pDot11dInfo)
IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for DOT11D\n");
- memset(ieee->pDot11dInfo, 0, sizeof(RT_DOT11D_INFO));
//added for AP roaming
ieee->LinkDetectInfo.SlotNum = 2;
ieee->LinkDetectInfo.NumRecvBcnInPeriod=0;