Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c48e3fca authored by Yan Burman's avatar Yan Burman Committed by Adrian Bunk
Browse files

e100: replace kmalloc with kcalloc



Replace kmalloc+memset with kcalloc

Signed-off-by: default avatarYan Burman <burman.yan@gmail.com>
Acked-By: default avatarAuke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 0268bd0a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1930,9 +1930,8 @@ static int e100_rx_alloc_list(struct nic *nic)
	nic->rx_to_use = nic->rx_to_clean = NULL;
	nic->ru_running = RU_UNINITIALIZED;

	if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC)))
	if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
		return -ENOMEM;
	memset(nic->rxs, 0, sizeof(struct rx) * count);

	for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
		rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;