many: final set of coccinelle check-pointer-deref tweaks (#41426)

This is a followup to https://github.com/systemd/systemd/pull/41400 with
the final set of tweaks so that the new coccinelle `check-pinters-deref`
checker runs without failures.

It also includes a commit with some fixes for redundant asserts and the
final commit to make the assert() in the inner loop of qsort
POINTER_MAY_BE_NULL which will become a no-op - that is probably the
most controversial one, I hope the commit message explains the
trade-offs, I'm happy to drop it, I have no strong opinion either way.

Please see the individual commits/commit messages for more details, most
is (hopefully) relatively boring/mechanical.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-04-03 19:27:09 +02:00
committed by GitHub
73 changed files with 277 additions and 26 deletions
+2
View File
@@ -33,6 +33,8 @@
#include "time-util.h"
static void cleanup_clear_loop_close(int *fd) {
assert(fd);
if (*fd < 0)
return;