Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1ecafede835321ebdc396531245adc37d22366f7
Commit:     1ecafede835321ebdc396531245adc37d22366f7
Parent:     32f0c4cbe495d121c09ed14d9c84f9e1b9574415
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 9 13:24:07 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:54:59 2007 -0700

    [IPSEC]: Remove bogus ref count in xfrm_secpath_reject
    
    Constructs of the form
    
        xfrm_state_hold(x);
        foo(x);
        xfrm_state_put(x);
    
    tend to be broken because foo is either synchronous where this is totally
    unnecessary or if foo is asynchronous then the reference count is in the
    wrong spot.
    
    In the case of xfrm_secpath_reject, the function is synchronous and 
therefore
    we should just kill the reference count.
    
    Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/xfrm/xfrm_policy.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 76f172f..af27c19 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1682,17 +1682,13 @@ static inline int
 xfrm_secpath_reject(int idx, struct sk_buff *skb, struct flowi *fl)
 {
        struct xfrm_state *x;
-       int err;
 
        if (!skb->sp || idx < 0 || idx >= skb->sp->len)
                return 0;
        x = skb->sp->xvec[idx];
        if (!x->type->reject)
                return 0;
-       xfrm_state_hold(x);
-       err = x->type->reject(x, skb, fl);
-       xfrm_state_put(x);
-       return err;
+       return x->type->reject(x, skb, fl);
 }
 
 /* When skb is transformed back to its "native" form, we have to
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to