From: Masami Hiramatsu Date: Fri, 20 Nov 2020 02:29:04 +0000 (+0900) Subject: bootconfig: Load size and checksum in the footer as le32 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=24aed09451270b6a2a78adf8a34918d12ffb7dcf;p=linux.git bootconfig: Load size and checksum in the footer as le32 Load the size and the checksum fields in the footer as le32 instead of u32. This will allow us to apply bootconfig to the cross build initrd without caring the endianness. Link: https://lkml.kernel.org/r/160583934457.547349.10504070298990791074.stgit@devnote2 Reported-by: Steven Rostedt Suggested-by: Linus Torvalds Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) --- diff --git a/init/main.c b/init/main.c index 20baced721ad4..32b2a8affafd1 100644 --- a/init/main.c +++ b/init/main.c @@ -288,8 +288,8 @@ static void * __init get_boot_config_from_initrd(u32 *_size, u32 *_csum) found: hdr = (u32 *)(data - 8); - size = hdr[0]; - csum = hdr[1]; + size = le32_to_cpu(hdr[0]); + csum = le32_to_cpu(hdr[1]); data = ((void *)hdr) - size; if ((unsigned long)data < initrd_start) {