Skip to content

Commit 24aed09

Browse files
mhiramatrostedt
authored andcommitted
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 <[email protected]> Suggested-by: Linus Torvalds <[email protected]> Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent 68e10d5 commit 24aed09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

init/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ static void * __init get_boot_config_from_initrd(u32 *_size, u32 *_csum)
288288

289289
found:
290290
hdr = (u32 *)(data - 8);
291-
size = hdr[0];
292-
csum = hdr[1];
291+
size = le32_to_cpu(hdr[0]);
292+
csum = le32_to_cpu(hdr[1]);
293293

294294
data = ((void *)hdr) - size;
295295
if ((unsigned long)data < initrd_start) {

0 commit comments

Comments
 (0)