xfrm: remove the unnecessary checking before call xfrm_pol_hold
Subsystems (3)
PATCH 1/1 xfrm: remove the unnecessary checking before call xfrm_pol_hold
From: Li RongQing <[email protected]>
xfrm_pol_hold will check its input with NULL
Signed-off-by Li RongQing <[email protected]>
--- net/xfrm/xfrm_policy.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
net/xfrm/xfrm_policy.c +3 -4
@@ -1133,8 +1133,8 @@ static struct xfrm_policy *xfrm_policy_lookup_bytype(struct net *net, u8 type,break ; } } -if (ret) -xfrm_pol_hold (ret); + +xfrm_pol_hold (ret); fail:read_unlock_bh (&net->xfrm.xfrm_policy_lock);
@@ -3217,8 +3217,7 @@ static struct xfrm_policy *xfrm_migrate_policy_find(const struct xfrm_selector * } } -if (ret) -xfrm_pol_hold (ret); +xfrm_pol_hold (ret);read_unlock_bh (&net->xfrm.xfrm_policy_lock);
Signature · 1 line
2.1.0
Quoted 5 lines · On Thu, Apr 30, 2015 at 05:13:41PM +0800, [email protected] wrote:
From: Li RongQing <[email protected]>
xfrm_pol_holdwill check its input with NULLSigned-off-by Li RongQing <[email protected]>
Applied to ipsec-next, thanks!