summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel
diff options
context:
space:
mode:
authorChen Ni <nichen@iscas.ac.cn>2024-07-04 17:06:22 +0800
committerKalle Valo <kvalo@kernel.org>2024-07-09 13:16:05 +0300
commit3588e6438a1c2e353616959ce16bce06aef0e424 (patch)
tree3cafc872da1139dc8362126385b0ea298b4be43c /drivers/net/wireless/intel
parentc145eea2f75ff7949392aebecf7ef0a81c1f6c14 (diff)
wifi: ipw2x00: Use kzalloc() instead of kmalloc()/memset()
Replace kmalloc() + memset() to kzalloc() for better code readability and simplicity. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://patch.msgid.link/20240704090622.2260102-1-nichen@iscas.ac.cn
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r--drivers/net/wireless/intel/ipw2x00/libipw_tx.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
index 4aec1fce1ae2..e22a6732a4c3 100644
--- a/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
+++ b/drivers/net/wireless/intel/ipw2x00/libipw_tx.c
@@ -180,11 +180,10 @@ static struct libipw_txb *libipw_alloc_txb(int nr_frags, int txb_size,
struct libipw_txb *txb;
int i;
- txb = kmalloc(struct_size(txb, fragments, nr_frags), gfp_mask);
+ txb = kzalloc(struct_size(txb, fragments, nr_frags), gfp_mask);
if (!txb)
return NULL;
- memset(txb, 0, sizeof(struct libipw_txb));
txb->nr_frags = nr_frags;
txb->frag_size = txb_size;