From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9166A2E63E for ; Mon, 9 Oct 2023 13:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="S1rYO1Me" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0FF3C433C7; Mon, 9 Oct 2023 13:29:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696858186; bh=tf3drTAHvw0ZXXtLi7ScIfxNchNEeBFgfRg0dGWGbGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S1rYO1MeHZLN/pMvIKoZRRtxItUjTsGOMMbY64llzM38KQ7uFOsv5+wxiuLD8dt9O FVAiPzRMMpX+HSMR1OtZWRASBQPwdHCQyI0/sspAKERJBNVSj6oECO0nGYJn6uMlsb VcvEYfn+n+vqVwhmYYRCbeCp7vRfM6uJJ/U65kog= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dan Carpenter , Kees Cook , Shuah Khan , Sasha Levin Subject: [PATCH 5.4 016/131] selftests/tls: Add {} to avoid static checker warning Date: Mon, 9 Oct 2023 15:00:56 +0200 Message-ID: <20231009130116.815713656@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009130116.329529591@linuxfoundation.org> References: <20231009130116.329529591@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kees Cook [ Upstream commit f50688b47c5858d2ff315d020332bf4cb6710837 ] 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 Fixes: 7f657d5bf507 ("selftests: tls: add selftests for TLS sockets") Signed-off-by: Kees Cook Signed-off-by: Shuah Khan Stable-dep-of: c326ca98446e ("selftests: tls: swap the TX and RX sockets in some tests") Signed-off-by: Sasha Levin --- tools/testing/selftests/net/tls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/tls.c b/tools/testing/selftests/net/tls.c index 0ea44d975b6c1..032e08e8ce016 100644 --- a/tools/testing/selftests/net/tls.c +++ b/tools/testing/selftests/net/tls.c @@ -314,8 +314,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); } -- 2.40.1