Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/kexec: fix incorrect argument passed to kexec_dprintk()

kexec_dprintk() expects the last argument to be kbuf.memsz, but the actual
argument being passed is kbuf.bufsz.

Although these two values are currently equal, it is better to pass the
correct one, in case these two values become different in the future.

Link: https://lkml.kernel.org/r/20231220154105.215610-1-ytcoode@gmail.com
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Yuntao Wang and committed by
Andrew Morton
22bb6bcd 43132282

+1 -1
+1 -1
arch/x86/kernel/kexec-bzimage64.c
··· 496 496 goto out_free_params; 497 497 bootparam_load_addr = kbuf.mem; 498 498 kexec_dprintk("Loaded boot_param, command line and misc at 0x%lx bufsz=0x%lx memsz=0x%lx\n", 499 - bootparam_load_addr, kbuf.bufsz, kbuf.bufsz); 499 + bootparam_load_addr, kbuf.bufsz, kbuf.memsz); 500 500 501 501 /* Load kernel */ 502 502 kbuf.buffer = kernel + kern16_size;