summaryrefslogtreecommitdiff
path: root/drivers/staging/wlan-ng/p80211conv.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-05-13 20:00:05 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-14 21:02:56 (GMT)
commit7a6cb0d5497418599d2125b670926b75e673861c (patch)
treea698dc86695304ef6aefe4bc6d18fdad7f3770ee /drivers/staging/wlan-ng/p80211conv.c
parentb5a2104c98cb603f7053e4b0309fb88f15d6be86 (diff)
downloadlinux-fsl-qoriq-7a6cb0d5497418599d2125b670926b75e673861c.tar.xz
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/wlan-ng/p80211conv.c')
-rw-r--r--drivers/staging/wlan-ng/p80211conv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/wlan-ng/p80211conv.c b/drivers/staging/wlan-ng/p80211conv.c
index 71c3595..059e150 100644
--- a/drivers/staging/wlan-ng/p80211conv.c
+++ b/drivers/staging/wlan-ng/p80211conv.c
@@ -601,7 +601,7 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
}
/* Allocate the rxmeta */
- rxmeta = kmalloc(sizeof(p80211_rxmeta_t), GFP_ATOMIC);
+ rxmeta = kzalloc(sizeof(p80211_rxmeta_t), GFP_ATOMIC);
if (rxmeta == NULL) {
printk(KERN_ERR "%s: Failed to allocate rxmeta.\n",
@@ -611,7 +611,6 @@ int p80211skb_rxmeta_attach(struct wlandevice *wlandev, struct sk_buff *skb)
}
/* Initialize the rxmeta */
- memset(rxmeta, 0, sizeof(p80211_rxmeta_t));
rxmeta->wlandev = wlandev;
rxmeta->hosttime = jiffies;