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 <iii@linux.ibm.com>
Acked-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Richie Buturla <richie@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Richie Buturla
2025-08-15 16:56:15 +02:00
committed by Steffen Eiden
parent 8e315c4401
commit bed1bc8676

View File

@@ -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();