Commit 3dbd4439 authored by Joe Perches's avatar Joe Perches Committed by Jiri Kosina

net: Convert vmalloc/memset to vzalloc

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 8c1fec1b
...@@ -776,12 +776,11 @@ static int xt_jumpstack_alloc(struct xt_table_info *i) ...@@ -776,12 +776,11 @@ static int xt_jumpstack_alloc(struct xt_table_info *i)
size = sizeof(void **) * nr_cpu_ids; size = sizeof(void **) * nr_cpu_ids;
if (size > PAGE_SIZE) if (size > PAGE_SIZE)
i->jumpstack = vmalloc(size); i->jumpstack = vzalloc(size);
else else
i->jumpstack = kmalloc(size, GFP_KERNEL); i->jumpstack = kzalloc(size, GFP_KERNEL);
if (i->jumpstack == NULL) if (i->jumpstack == NULL)
return -ENOMEM; return -ENOMEM;
memset(i->jumpstack, 0, size);
i->stacksize *= xt_jumpstack_multiplier; i->stacksize *= xt_jumpstack_multiplier;
size = sizeof(void *) * i->stacksize; size = sizeof(void *) * i->stacksize;
......
...@@ -375,23 +375,21 @@ static int rds_ib_setup_qp(struct rds_connection *conn) ...@@ -375,23 +375,21 @@ static int rds_ib_setup_qp(struct rds_connection *conn)
goto out; goto out;
} }
ic->i_sends = vmalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work), ic->i_sends = vzalloc_node(ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work),
ibdev_to_node(dev)); ibdev_to_node(dev));
if (!ic->i_sends) { if (!ic->i_sends) {
ret = -ENOMEM; ret = -ENOMEM;
rdsdebug("send allocation failed\n"); rdsdebug("send allocation failed\n");
goto out; goto out;
} }
memset(ic->i_sends, 0, ic->i_send_ring.w_nr * sizeof(struct rds_ib_send_work));
ic->i_recvs = vmalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work), ic->i_recvs = vzalloc_node(ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work),
ibdev_to_node(dev)); ibdev_to_node(dev));
if (!ic->i_recvs) { if (!ic->i_recvs) {
ret = -ENOMEM; ret = -ENOMEM;
rdsdebug("recv allocation failed\n"); rdsdebug("recv allocation failed\n");
goto out; goto out;
} }
memset(ic->i_recvs, 0, ic->i_recv_ring.w_nr * sizeof(struct rds_ib_recv_work));
rds_ib_recv_init_ack(ic); rds_ib_recv_init_ack(ic);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment