Commit 3588e643 authored by Chen Ni's avatar Chen Ni Committed by Kalle Valo

wifi: ipw2x00: Use kzalloc() instead of kmalloc()/memset()

Replace kmalloc() + memset() to kzalloc() for
better code readability and simplicity.
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20240704090622.2260102-1-nichen@iscas.ac.cn
parent c145eea2
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment