Skip to content

Commit

Permalink
e100: replace kmalloc with kcalloc
Browse files Browse the repository at this point in the history
Replace kmalloc+memset with kcalloc

Signed-off-by: Yan Burman <burman.yan@gmail.com>
Acked-By: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
  • Loading branch information
Yan Burman authored and Adrian Bunk committed Dec 12, 2006
1 parent 0268bd0 commit c48e3fc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c48e3fc

Please sign in to comment.