From: Li RongQing Date: Thu, 30 Apr 2015 09:13:41 +0000 (+0800) Subject: xfrm: remove the unnecessary checking before call xfrm_pol_hold X-Git-Tag: v4.2-rc1~130^2~192^2~2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=586f2eb416f4271444e807b96346df3d30e8dfb5;p=uclinux-h8%2Flinux.git xfrm: remove the unnecessary checking before call xfrm_pol_hold xfrm_pol_hold will check its input with NULL Signed-off-by: Li RongQing Signed-off-by: Steffen Klassert --- diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c4c47f337a3a..435bc0dc7630 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1127,8 +1127,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); @@ -3211,8 +3211,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);