diff options
author | Jean Sacren <sakiwit@gmail.com> | 2021-11-30 00:03:12 -0700 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2021-12-01 09:23:01 +0100 |
commit | ac1077e92825bb0ffeee8550a41771df772214ce (patch) | |
tree | df991243f6413799e64d01db09289d697f4145db /net/xfrm | |
parent | 2e1809208a4a52e883527c288b4fca61a90100b2 (diff) | |
download | linux-stable-ac1077e92825bb0ffeee8550a41771df772214ce.tar.gz linux-stable-ac1077e92825bb0ffeee8550a41771df772214ce.tar.bz2 linux-stable-ac1077e92825bb0ffeee8550a41771df772214ce.zip |
net: xfrm: drop check of pols[0] for the second time
!pols[0] is checked earlier. If we don't return, pols[0] is always
true. We should drop the check of pols[0] for the second time and the
binary is also smaller.
Before:
text data bss dec hex filename
48395 957 240 49592 c1b8 net/xfrm/xfrm_policy.o
After:
text data bss dec hex filename
48379 957 240 49576 c1a8 net/xfrm/xfrm_policy.o
Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_policy.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index edc673e78114..9341298b2a70 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2680,7 +2680,7 @@ static int xfrm_expand_policies(const struct flowi *fl, u16 family, *num_xfrms = pols[0]->xfrm_nr; #ifdef CONFIG_XFRM_SUB_POLICY - if (pols[0] && pols[0]->action == XFRM_POLICY_ALLOW && + if (pols[0]->action == XFRM_POLICY_ALLOW && pols[0]->type != XFRM_POLICY_TYPE_MAIN) { pols[1] = xfrm_policy_lookup_bytype(xp_net(pols[0]), XFRM_POLICY_TYPE_MAIN, |