Index | Thread | Search

From:
Thorsten Blum <thorsten.blum@toblux.com>
Subject:
Re: kern_timeout: Drop self-assignment in db_show_timeout
To:
Vitaliy Makkoveev <mvs@openbsd.org>
Cc:
tech@openbsd.org
Date:
Mon, 13 Oct 2025 03:45:00 +0200

Download raw body.

Thread
On 13. Oct 2025, at 00:06, Vitaliy Makkoveev wrote:
> kern_timeout.c checks pointers against NULL. ok mvs@ with this idiom.

ok thanks

Index: kern/kern_timeout.c
===================================================================
RCS file: /cvs/src/sys/kern/kern_timeout.c,v
retrieving revision 1.112
diff -u -p -r1.112 kern_timeout.c
--- kern/kern_timeout.c	28 Jul 2025 05:25:44 -0000	1.112
+++ kern/kern_timeout.c	13 Oct 2025 01:26:34 -0000
@@ -980,7 +980,8 @@ db_show_timeout(struct timeout *to, stru
	int width = sizeof(long) * 2;

	db_find_sym_and_offset((vaddr_t)to->to_func, &name, &offset);
-	name = name ? name : "?";
+	if (name == NULL)
+		name = "?";
	if (bucket == &timeout_new)
		where = "new";
	else if (bucket == &timeout_todo)