Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78685
b: refs/heads/master
c: 64c31b3
h: refs/heads/master
i:
  78683: 29c54e2
v: v3
  • Loading branch information
WANG Cong authored and David S. Miller committed Jan 28, 2008
1 parent fd6b714 commit f559820
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d66e37a99d323012165ce91fd5c4518e2fcea0c5
refs/heads/master: 64c31b3f76482bb64459e786f9eca3bd0164d153
4 changes: 2 additions & 2 deletions trunk/include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,12 @@ static inline void xfrm_pol_hold(struct xfrm_policy *policy)
atomic_inc(&policy->refcnt);
}

extern void __xfrm_policy_destroy(struct xfrm_policy *policy);
extern void xfrm_policy_destroy(struct xfrm_policy *policy);

static inline void xfrm_pol_put(struct xfrm_policy *policy)
{
if (atomic_dec_and_test(&policy->refcnt))
__xfrm_policy_destroy(policy);
xfrm_policy_destroy(policy);
}

#ifdef CONFIG_XFRM_SUB_POLICY
Expand Down
6 changes: 2 additions & 4 deletions trunk/net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -2291,8 +2291,7 @@ static int pfkey_spdadd(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
return 0;

out:
security_xfrm_policy_free(xp);
kfree(xp);
xfrm_policy_destroy(xp);
return err;
}

Expand Down Expand Up @@ -3236,8 +3235,7 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
return xp;

out:
security_xfrm_policy_free(xp);
kfree(xp);
xfrm_policy_destroy(xp);
return NULL;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/xfrm/xfrm_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ EXPORT_SYMBOL(xfrm_policy_alloc);

/* Destroy xfrm_policy: descendant resources must be released to this moment. */

void __xfrm_policy_destroy(struct xfrm_policy *policy)
void xfrm_policy_destroy(struct xfrm_policy *policy)
{
BUG_ON(!policy->dead);

Expand All @@ -233,7 +233,7 @@ void __xfrm_policy_destroy(struct xfrm_policy *policy)
security_xfrm_policy_free(policy);
kfree(policy);
}
EXPORT_SYMBOL(__xfrm_policy_destroy);
EXPORT_SYMBOL(xfrm_policy_destroy);

static void xfrm_policy_gc_kill(struct xfrm_policy *policy)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/xfrm/xfrm_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ static struct xfrm_policy *xfrm_policy_construct(struct xfrm_userpolicy_info *p,
return xp;
error:
*errp = err;
kfree(xp);
xfrm_policy_destroy(xp);
return NULL;
}

Expand Down

0 comments on commit f559820

Please sign in to comment.