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>] [day] [month] [year] [list]
Message-ID: <00c2ed58-2a99-4b5b-ac0e-45ee6171e186@gmail.com>
Date: Sat, 6 Jul 2024 00:05:59 +0200
From: Mirsad Todorovac <mtodorovac69@...il.com>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Cc: Lubomir Rintel <lkundrak@...sk>, Thomas Gleixner <tglx@...utronix.de>,
 Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
 Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
 "H. Peter Anvin" <hpa@...or.com>,
 Sebastian Reichel <sebastian.reichel@...labora.com>,
 Pavel Machek <pavel@....cz>
Subject: [PROBLEM] arch/x86/platform/olpc/olpc_dt.c:222:19: error: variable ‘len’ set but not used [-Werror=unused-but-set-variable]

Hi, all!

This is the result of testing randconfig with KCONFIG_SEED=0xEE7AB52F in next-20240703 vanilla tree on
Ubuntu 22.04 LTS. GCC used is gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0.

The particular error is as follows:

arch/x86/platform/olpc/olpc_dt.c: In function ‘olpc_dt_compatible_match’:
arch/x86/platform/olpc/olpc_dt.c:222:19: error: variable ‘len’ set but not used [-Werror=unused-but-set-variable]
  222 |         int plen, len;
      |                   ^~~

  219 static int __init olpc_dt_compatible_match(phandle node, const char *compat)
  220 {
  221         char buf[64], *p;
→ 222         int plen, len;
  223 
  224         plen = olpc_dt_getproperty(node, "compatible", buf, sizeof(buf));
  225         if (plen <= 0)
  226                 return 0;
  227 
→ 228         len = strlen(compat);
  229         for (p = buf; p < buf + plen; p += strlen(p) + 1) {
  230                 if (strcmp(p, compat) == 0)
  231                         return 1;
  232         }
  233 
  234         return 0;
  235 }

This looks like a minor issue: len assigned strlen(compat), but never used.

The code was introduced with the commit a7a9bacb9a32f.

Hope this helps.

Best regards,
Mirsad Todorovac
View attachment ".config" of type "text/plain" (134537 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ