Commit e63dd412 authored by Haowen Bai's avatar Haowen Bai Committed by David S. Miller
Browse files

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: default avatarHaowen Bai <baihaowen@meizu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fcd30c96
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);