Commit ff7907aede7962629c2eb50e08b870316c80518f
Committed by
Jeff Garzik
1 parent
93aea718c6
[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>
Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff
drivers/net/skge.c
... | ... | @@ -733,13 +733,12 @@ |
733 | 733 | struct skge_element *e; |
734 | 734 | int i; |
735 | 735 | |
736 | - ring->start = kmalloc(sizeof(*e)*ring->count, GFP_KERNEL); | |
736 | + ring->start = kcalloc(sizeof(*e), ring->count, GFP_KERNEL); | |
737 | 737 | if (!ring->start) |
738 | 738 | return -ENOMEM; |
739 | 739 | |
740 | 740 | for (i = 0, e = ring->start, d = vaddr; i < ring->count; i++, e++, d++) { |
741 | 741 | e->desc = d; |
742 | - e->skb = NULL; | |
743 | 742 | if (i == ring->count - 1) { |
744 | 743 | e->next = ring->start; |
745 | 744 | d->next_offset = base; |