1 From adb4079f56d1f6c7d4dc827d7eba14e3436512f9 Mon Sep 17 00:00:00 2001
2 From: Frank Werner-Krippendorf <mail@hb9fxq.ch>
3 Date: Tue, 23 Jun 2020 03:59:44 -0600
4 Subject: [PATCH 107/124] wireguard: noise: do not assign initiation time in if
7 commit 558b353c9c2a717509f291c066c6bd8f5f5e21be upstream.
9 Fixes an error condition reported by checkpatch.pl which caused by
10 assigning a variable in an if condition in wg_noise_handshake_consume_
13 Signed-off-by: Frank Werner-Krippendorf <mail@hb9fxq.ch>
14 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
15 Signed-off-by: David S. Miller <davem@davemloft.net>
16 Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
18 drivers/net/wireguard/noise.c | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
21 --- a/drivers/net/wireguard/noise.c
22 +++ b/drivers/net/wireguard/noise.c
23 @@ -617,8 +617,8 @@ wg_noise_handshake_consume_initiation(st
24 memcpy(handshake->hash, hash, NOISE_HASH_LEN);
25 memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN);
26 handshake->remote_index = src->sender_index;
27 - if ((s64)(handshake->last_initiation_consumption -
28 - (initiation_consumption = ktime_get_coarse_boottime_ns())) < 0)
29 + initiation_consumption = ktime_get_coarse_boottime_ns();
30 + if ((s64)(handshake->last_initiation_consumption - initiation_consumption) < 0)
31 handshake->last_initiation_consumption = initiation_consumption;
32 handshake->state = HANDSHAKE_CONSUMED_INITIATION;
33 up_write(&handshake->lock);