提交 ff7907ae 编写于 作者: S Stephen Hemminger 提交者: Jeff Garzik

[PATCH] skge: use kcalloc

Use kcalloc when allocating ring data structure.
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 93aea718
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册