xfrm: remove redundant replay_esn check
authorUlrich Weber <ulrich.weber@sophos.com>
Thu, 8 Nov 2012 10:15:44 +0000 (11:15 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 8 Nov 2012 11:42:49 +0000 (12:42 +0100)
x->replay_esn is already checked in if clause,
so remove check and ident properly

Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_replay.c

index 3efb07d3eb27425c8b9b5114c925eb9e7f402c9e..765f6fe951ebc7ed8fabaed3a4dc6ea4299aebfa 100644 (file)
@@ -521,13 +521,12 @@ int xfrm_init_replay(struct xfrm_state *x)
                    replay_esn->bmp_len * sizeof(__u32) * 8)
                        return -EINVAL;
 
                    replay_esn->bmp_len * sizeof(__u32) * 8)
                        return -EINVAL;
 
-       if ((x->props.flags & XFRM_STATE_ESN) && replay_esn->replay_window == 0)
-               return -EINVAL;
-
-       if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn)
-               x->repl = &xfrm_replay_esn;
-       else
-               x->repl = &xfrm_replay_bmp;
+               if (x->props.flags & XFRM_STATE_ESN) {
+                       if (replay_esn->replay_window == 0)
+                               return -EINVAL;
+                       x->repl = &xfrm_replay_esn;
+               } else
+                       x->repl = &xfrm_replay_bmp;
        } else
                x->repl = &xfrm_replay_legacy;
 
        } else
                x->repl = &xfrm_replay_legacy;