[PATCH] skge: use kcalloc
authorStephen Hemminger <shemminger@osdl.org>
Tue, 21 Mar 2006 18:57:03 +0000 (10:57 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 21 Mar 2006 21:00:51 +0000 (16:00 -0500)
Use kcalloc when allocating ring data structure.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/skge.c

index 381669cc415feb5719f0b06ffa3a024d1f232444..5ece10034df93e0f4878ef5314fe18c63bad3b3f 100644 (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;