summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2021-05-26 20:27:19 -0700
committerShuah Khan <skhan@linuxfoundation.org>2021-06-07 18:39:29 -0600
commitf50688b47c5858d2ff315d020332bf4cb6710837 (patch)
treef47efacceb4bf543de08c0f3b6a9d2ab57dd85b3
parent1421ec684a43379b2aa3cfda20b03d38282dc990 (diff)
downloadlinux-f50688b47c5858d2ff315d020332bf4cb6710837.tar.gz
linux-f50688b47c5858d2ff315d020332bf4cb6710837.tar.bz2
linux-f50688b47c5858d2ff315d020332bf4cb6710837.zip
selftests/tls: Add {} to avoid static checker warning
This silences a static checker warning due to the unusual macro construction of EXPECT_*() by adding explicit {}s around the enclosing while loop. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets") Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
-rw-r--r--tools/testing/selftests/net/tls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c
index 426d07875a48..7119f8eb823b 100644
--- a/tools/testing/selftests/net/tls.c
+++ b/tools/testing/selftests/net/tls.c
@@ -418,8 +418,9 @@ TEST_F(tls, sendmsg_large)
EXPECT_EQ(sendmsg(self->cfd, &msg, 0), send_len);
}
- while (recvs++ < sends)
+ while (recvs++ < sends) {
EXPECT_NE(recv(self->fd, mem, send_len, 0), -1);
+ }
free(mem);
}