From bed1bc8676ee82f7523d45cc48327a3c3716047a Mon Sep 17 00:00:00 2001 From: Richie Buturla Date: Fri, 15 Aug 2025 16:56:15 +0200 Subject: [PATCH] zipl/boot/stage3.c: Fix [-Wnull-dereference] warning Fix 'volatile' qualifier warning, indirection of non-volatile null pointer will be deleted, not trap. Acked-by: Ilya Leoshkevich Acked-by: Marc Hartmayer Reviewed-by: Steffen Eiden Signed-off-by: Richie Buturla Signed-off-by: Steffen Eiden --- zipl/boot/stage3.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zipl/boot/stage3.c b/zipl/boot/stage3.c index 76275f65..0207cf23 100644 --- a/zipl/boot/stage3.c +++ b/zipl/boot/stage3.c @@ -525,8 +525,12 @@ void start(void) *(unsigned long long *)INITRD_START = _stage3_parms.initrd_addr; *(unsigned long long *)INITRD_SIZE = _stage3_parms.initrd_len; - /* store address of new kernel to 0 to be able to start it */ - *(unsigned long long *)0 = _stage3_parms.load_psw; + /* + * store address of new kernel to 0 to be able to start it. + * -fno-delete-null-pointer-checks allows us to dereference 0 here, + * which otherwise would be an UB. + */ + *(volatile unsigned long long *)0 = _stage3_parms.load_psw; kdump_stage3();