Skip to content

Commit e63dd41

Browse files
Lotte-Baidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent fcd30c9 commit e63dd41

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/net/wireless/ath/ar5523/ar5523.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,7 +1500,7 @@ static int ar5523_load_firmware(struct usb_device *dev)
15001500
return -ENOENT;
15011501
}
15021502

1503-
txblock = kmalloc(sizeof(*txblock), GFP_KERNEL);
1503+
txblock = kzalloc(sizeof(*txblock), GFP_KERNEL);
15041504
if (!txblock)
15051505
goto out;
15061506

@@ -1512,7 +1512,6 @@ static int ar5523_load_firmware(struct usb_device *dev)
15121512
if (!fwbuf)
15131513
goto out_free_rxblock;
15141514

1515-
memset(txblock, 0, sizeof(struct ar5523_fwblock));
15161515
txblock->flags = cpu_to_be32(AR5523_WRITE_BLOCK);
15171516
txblock->total = cpu_to_be32(fw->size);
15181517

0 commit comments

Comments
 (0)