]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
xfrm: fix a read lock imbalance in make_blackhole
authorLi RongQing <roy.qing.li@gmail.com>
Mon, 17 Sep 2012 22:40:10 +0000 (22:40 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Oct 2012 20:38:40 +0000 (05:38 +0900)
[ Upstream commit 433a19548061bb5457b6ab77ed7ea58ca6e43ddb ]

if xfrm_policy_get_afinfo returns 0, it has already released the read
lock, xfrm_policy_put_afinfo should not be called again.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/xfrm/xfrm_policy.c

index a15d2a03172a4ab0015136911ffde32ba5e76e83..71c80c763d571d648de98b66ed4391200ba88fe6 100644 (file)
@@ -1761,7 +1761,7 @@ static struct dst_entry *make_blackhole(struct net *net, u16 family,
 
        if (!afinfo) {
                dst_release(dst_orig);
-               ret = ERR_PTR(-EINVAL);
+               return ERR_PTR(-EINVAL);
        } else {
                ret = afinfo->blackhole_route(net, dst_orig);
        }