Skip to content

Commit

Permalink
[PATCH] s2io bogus memset
Browse files Browse the repository at this point in the history
memset() after kmalloc() on size * 8 would better be on size * 8, not
just size; fixed by switching to kcalloc() - it's more idiomatic anyway.

Signed-off-by: Al Viro <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jan 23, 2007
1 parent 0a3c4bd commit 4384247
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/s2io.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,9 @@ static int init_shared_mem(struct s2io_nic *nic)
}
}

nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL);
nic->ufo_in_band_v = kcalloc(size, sizeof(u64), GFP_KERNEL);
if (!nic->ufo_in_band_v)
return -ENOMEM;
memset(nic->ufo_in_band_v, 0, size);

/* Allocation and initialization of RXDs in Rings */
size = 0;
Expand Down

0 comments on commit 4384247

Please sign in to comment.