s2io bogus memset
authorAl Viro <viro@ftp.linux.org.uk>
Tue, 23 Jan 2007 12:25:08 +0000 (12:25 +0000)
committerJeff Garzik <jeff@garzik.org>
Tue, 23 Jan 2007 21:26:33 +0000 (16:26 -0500)
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 <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/s2io.c

index 250cdbeefdfde0da0641c999e6af0f0272351aa0..1dd66b8ea0fae545e12b70da9e45a7b01c16d79b 100644 (file)
@@ -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;