lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 22 Nov 2018 00:52:44 -0700
From:   Nathan Chancellor <natechancellor@...il.com>
To:     Thierry Reding <thierry.reding@...il.com>,
        Jonathan Hunter <jonathanh@...dia.com>
Cc:     Yangtao Li <tiny.windzz@...il.com>, linux-tegra@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Nathan Chancellor <natechancellor@...il.com>
Subject: [PATCH] soc/tegra: Fix terminating condition

Clang warns:

drivers/soc/tegra/common.c:27:16: error: address of array
'match->compatible' will always evaluate to 'true'
[-Werror,-Wpointer-bool-conversion]
        while (match->compatible) {
        ~~~~~  ~~~~~~~^~~~~~~~~~
1 error generated.

Whoops, we have an infinite loop and QEMU no longer boots...

https://travis-ci.com/ClangBuiltLinux/continuous-integration/jobs/160242918

Check that the first character of the string isn't null so that the loop
properly terminates.

Fixes: c57eff9503a5 ("soc/tegra: refactor soc_is_tegra()")
Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
---
 drivers/soc/tegra/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/tegra/common.c b/drivers/soc/tegra/common.c
index 8a538b968fe9..54627ca957e8 100644
--- a/drivers/soc/tegra/common.c
+++ b/drivers/soc/tegra/common.c
@@ -24,7 +24,7 @@ bool soc_is_tegra(void)
 {
 	const struct of_device_id *match = tegra_machine_match;
 
-	while (match->compatible) {
+	while (match->compatible[0]) {
 		if (of_machine_is_compatible(match->compatible))
 			return true;
 
-- 
2.20.0.rc1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ