From 7186e0a5fc460cf1c1e3f367ee1b627024831cef Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Tue, 11 Dec 2007 04:38:08 -0800 Subject: [PATCH] --- yaml --- r: 74806 b: refs/heads/master c: 75b8c133267053c9986a7c8db5131f0e7349e806 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/xfrm/xfrm_policy.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 422f9d572c5c..fdb73ef80d94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3f03e387893ffa07a4d5dac96772f9db3221a185 +refs/heads/master: 75b8c133267053c9986a7c8db5131f0e7349e806 diff --git a/trunk/net/xfrm/xfrm_policy.c b/trunk/net/xfrm/xfrm_policy.c index 9a4cf2e45a15..b91b16671c1e 100644 --- a/trunk/net/xfrm/xfrm_policy.c +++ b/trunk/net/xfrm/xfrm_policy.c @@ -1318,8 +1318,9 @@ int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, if (sk && sk->sk_policy[XFRM_POLICY_OUT]) { policy = xfrm_sk_policy_lookup(sk, XFRM_POLICY_OUT, fl); + err = PTR_ERR(policy); if (IS_ERR(policy)) - return PTR_ERR(policy); + goto dropdst; } if (!policy) { @@ -1330,8 +1331,9 @@ int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, policy = flow_cache_lookup(fl, dst_orig->ops->family, dir, xfrm_policy_lookup); + err = PTR_ERR(policy); if (IS_ERR(policy)) - return PTR_ERR(policy); + goto dropdst; } if (!policy) @@ -1501,8 +1503,9 @@ int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl, return 0; error: - dst_release(dst_orig); xfrm_pols_put(pols, npols); +dropdst: + dst_release(dst_orig); *dst_p = NULL; return err; }