diff options
author | Haowen Bai <baihaowen@meizu.com> | 2022-04-19 09:37:31 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-20 11:04:09 +0100 |
commit | e63dd41235072575a190ef3f3e6e618a6dd0ac64 (patch) | |
tree | b09663a3893c6303645ae914228d1c38d5fb15d2 | |
parent | fcd30c96af957f9c0eeccb95689548dfce52e149 (diff) | |
download | linux-e63dd41235072575a190ef3f3e6e618a6dd0ac64.tar.bz2 |
ar5523: Use kzalloc instead of kmalloc/memset
Use kzalloc rather than duplicating its implementation, which
makes code simple and easy to understand.
Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/wireless/ath/ar5523/ar5523.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c index 9cabd342d156..7527a382327f 100644 --- a/drivers/net/wireless/ath/ar5523/ar5523.c +++ b/drivers/net/wireless/ath/ar5523/ar5523.c @@ -1500,7 +1500,7 @@ static int ar5523_load_firmware(struct usb_device *dev) return -ENOENT; } - txblock = kmalloc(sizeof(*txblock), GFP_KERNEL); + txblock = kzalloc(sizeof(*txblock), GFP_KERNEL); if (!txblock) goto out; @@ -1512,7 +1512,6 @@ static int ar5523_load_firmware(struct usb_device *dev) if (!fwbuf) goto out_free_rxblock; - memset(txblock, 0, sizeof(struct ar5523_fwblock)); txblock->flags = cpu_to_be32(AR5523_WRITE_BLOCK); txblock->total = cpu_to_be32(fw->size); |