[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
a0ee7c70b2
commit
0da974f4f3
@@ -307,10 +307,9 @@ struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp)
|
||||
{
|
||||
struct xfrm_policy *policy;
|
||||
|
||||
policy = kmalloc(sizeof(struct xfrm_policy), gfp);
|
||||
policy = kzalloc(sizeof(struct xfrm_policy), gfp);
|
||||
|
||||
if (policy) {
|
||||
memset(policy, 0, sizeof(struct xfrm_policy));
|
||||
atomic_set(&policy->refcnt, 1);
|
||||
rwlock_init(&policy->lock);
|
||||
init_timer(&policy->timer);
|
||||
|
@@ -194,10 +194,9 @@ struct xfrm_state *xfrm_state_alloc(void)
|
||||
{
|
||||
struct xfrm_state *x;
|
||||
|
||||
x = kmalloc(sizeof(struct xfrm_state), GFP_ATOMIC);
|
||||
x = kzalloc(sizeof(struct xfrm_state), GFP_ATOMIC);
|
||||
|
||||
if (x) {
|
||||
memset(x, 0, sizeof(struct xfrm_state));
|
||||
atomic_set(&x->refcnt, 1);
|
||||
atomic_set(&x->tunnel_users, 0);
|
||||
INIT_LIST_HEAD(&x->bydst);
|
||||
|
Reference in New Issue
Block a user