From: Al Viro Date: Tue, 23 Jan 2007 12:25:08 +0000 (+0000) Subject: [PATCH] s2io bogus memset X-Git-Tag: v3.12-rc1~31893 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4384247b6910df91049f8d0bbd5c1075898ac290;p=kernel%2Fkernel-generic.git [PATCH] s2io bogus memset 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 Signed-off-by: Linus Torvalds --- diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 250cdbe..1dd66b8 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -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;