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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240617173426.10.I9adfcc6e69e279d7c083b677d9ddfb812a17d665@changeid>
Date: Mon, 17 Jun 2024 17:34:44 -0700
From: Douglas Anderson <dianders@...omium.org>
To: Daniel Thompson <daniel.thompson@...aro.org>
Cc: kgdb-bugreport@...ts.sourceforge.net,
	Douglas Anderson <dianders@...omium.org>,
	Christophe JAILLET <christophe.jaillet@...adoo.fr>,
	Jason Wessel <jason.wessel@...driver.com>,
	Thorsten Blum <thorsten.blum@...lux.com>,
	Yuran Pereira <yuran.pereira@...mail.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH 10/13] kdb: Replease simple_strtoul() with kstrtouint() in kdb_md()

The docs say you should use kstrtouint() instead of simple_strtoul(),
so do so. This nicely simplfies the code a little.

Signed-off-by: Douglas Anderson <dianders@...omium.org>
---

 kernel/debug/kdb/kdb_main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c
index c064ff093670..6dcbf4ea4bcd 100644
--- a/kernel/debug/kdb/kdb_main.c
+++ b/kernel/debug/kdb/kdb_main.c
@@ -1612,11 +1612,8 @@ static int kdb_md(int argc, const char **argv)
 		bytesperword = (int)(argv[0][2] - '0');
 		if (!argv[0][3])
 			valid = true;
-		else if (argv[0][3] == 'c' && argv[0][4]) {
-			char *p;
-			repeat = simple_strtoul(argv[0] + 4, &p, 10);
-			valid = !*p;
-		}
+		else if (argv[0][3] == 'c' && argv[0][4])
+			valid = kstrtouint(argv[0] + 4, 10, &repeat) == 0;
 	} else if (strcmp(argv[0], "md") == 0)
 		valid = true;
 	else if (strcmp(argv[0], "mds") == 0)
-- 
2.45.2.627.g7a2c4fd464-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ