Skip to content

Commit 558b353

Browse files
hb9fxqdavem330
authored andcommitted
wireguard: noise: do not assign initiation time in if condition
Fixes an error condition reported by checkpatch.pl which caused by assigning a variable in an if condition in wg_noise_handshake_consume_ initiation(). Signed-off-by: Frank Werner-Krippendorf <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f7fb92a commit 558b353

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/wireguard/noise.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,8 @@ wg_noise_handshake_consume_initiation(struct message_handshake_initiation *src,
617617
memcpy(handshake->hash, hash, NOISE_HASH_LEN);
618618
memcpy(handshake->chaining_key, chaining_key, NOISE_HASH_LEN);
619619
handshake->remote_index = src->sender_index;
620-
if ((s64)(handshake->last_initiation_consumption -
621-
(initiation_consumption = ktime_get_coarse_boottime_ns())) < 0)
620+
initiation_consumption = ktime_get_coarse_boottime_ns();
621+
if ((s64)(handshake->last_initiation_consumption - initiation_consumption) < 0)
622622
handshake->last_initiation_consumption = initiation_consumption;
623623
handshake->state = HANDSHAKE_CONSUMED_INITIATION;
624624
up_write(&handshake->lock);

0 commit comments

Comments
 (0)