summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/hostap/hostap_hw.c
diff options
context:
space:
mode:
authorYan Burman <burman.yan@gmail.com>2006-12-02 13:33:40 +0200
committerJohn W. Linville <linville@tuxdriver.com>2006-12-05 19:31:32 -0500
commitb0471bb7b779f5deea109e5bfdfe8c18d4a06241 (patch)
treed2fffb2916469c84b20a3e8e747cbf77d1a00e70 /drivers/net/wireless/hostap/hostap_hw.c
parent9cdac9657fda58ae39c2bbc8be396f5530ed8398 (diff)
[PATCH] hostap: replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc Signed-off-by: Yan Burman <burman.yan@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_hw.c')
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index ed00ebb6e7f4..9c503364ca3f 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -347,14 +347,12 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0,
if (signal_pending(current))
return -EINTR;
- entry = (struct hostap_cmd_queue *)
- kmalloc(sizeof(*entry), GFP_ATOMIC);
+ entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
if (entry == NULL) {
printk(KERN_DEBUG "%s: hfa384x_cmd - kmalloc failed\n",
dev->name);
return -ENOMEM;
}
- memset(entry, 0, sizeof(*entry));
atomic_set(&entry->usecnt, 1);
entry->type = CMD_SLEEP;
entry->cmd = cmd;
@@ -517,14 +515,12 @@ static int hfa384x_cmd_callback(struct net_device *dev, u16 cmd, u16 param0,
return -1;
}
- entry = (struct hostap_cmd_queue *)
- kmalloc(sizeof(*entry), GFP_ATOMIC);
+ entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
if (entry == NULL) {
printk(KERN_DEBUG "%s: hfa384x_cmd_callback - kmalloc "
"failed\n", dev->name);
return -ENOMEM;
}
- memset(entry, 0, sizeof(*entry));
atomic_set(&entry->usecnt, 1);
entry->type = CMD_CALLBACK;
entry->cmd = cmd;
@@ -3015,14 +3011,12 @@ static int prism2_set_tim(struct net_device *dev, int aid, int set)
iface = netdev_priv(dev);
local = iface->local;
- new_entry = (struct set_tim_data *)
- kmalloc(sizeof(*new_entry), GFP_ATOMIC);
+ new_entry = kzalloc(sizeof(*new_entry), GFP_ATOMIC);
if (new_entry == NULL) {
printk(KERN_DEBUG "%s: prism2_set_tim: kmalloc failed\n",
local->dev->name);
return -ENOMEM;
}
- memset(new_entry, 0, sizeof(*new_entry));
new_entry->aid = aid;
new_entry->set = set;