Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3196265e authored by Al Viro's avatar Al Viro Committed by Jeff Garzik
Browse files

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 184231bd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;