[PATCH] skge: use kcalloc

Use kcalloc when allocating ring data structure.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Stephen Hemminger 2006-03-21 10:57:03 -08:00 committed by Jeff Garzik
parent 93aea718c6
commit ff7907aede
1 changed files with 1 additions and 2 deletions

View File

@ -733,13 +733,12 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base)
struct skge_element *e;
int i;
ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL);
ring->start = kcalloc(sizeof(*e), ring->count, GFP_KERNEL);
if (!ring->start)
return -ENOMEM;
for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) {
e->desc = d;
e->skb = NULL;
if (i == ring->count - 1) {
e->next = ring->start;
d->next_offset = base;