Skip to content

Commit

Permalink
[PATCH] skge: use kcalloc
Browse files Browse the repository at this point in the history
Use kcalloc when allocating ring data structure.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Mar 21, 2006
1 parent 93aea71 commit ff7907a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ff7907a

Please sign in to comment.