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>
This commit is contained in:
Al Viro 2007-01-23 12:25:08 +00:00 коммит произвёл Jeff Garzik
Родитель 184231bdb4
Коммит 3196265e97
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -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;