1 |
From 24aed09451270b6a2a78adf8a34918d12ffb7dcf Mon Sep 17 00:00:00 2001 |
2 |
From: Masami Hiramatsu <mhiramat@kernel.org> |
3 |
Date: Fri, 20 Nov 2020 11:29:04 +0900 |
4 |
Subject: [PATCH 146/150] bootconfig: Load size and checksum in the footer as |
5 |
le32 |
6 |
|
7 |
Load the size and the checksum fields in the footer as le32 |
8 |
instead of u32. This will allow us to apply bootconfig to the |
9 |
cross build initrd without caring the endianness. |
10 |
|
11 |
Link: https://lkml.kernel.org/r/160583934457.547349.10504070298990791074.stgit@devnote2 |
12 |
|
13 |
Reported-by: Steven Rostedt <rostedt@goodmis.org> |
14 |
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> |
15 |
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> |
16 |
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> |
17 |
--- |
18 |
init/main.c | 4 ++-- |
19 |
1 file changed, 2 insertions(+), 2 deletions(-) |
20 |
|
21 |
diff --git a/init/main.c b/init/main.c |
22 |
index 20baced721ad..32b2a8affafd 100644 |
23 |
--- a/init/main.c |
24 |
+++ b/init/main.c |
25 |
@@ -288,8 +288,8 @@ static void * __init get_boot_config_from_initrd(u32 *_size, u32 *_csum) |
26 |
|
27 |
found: |
28 |
hdr = (u32 *)(data - 8); |
29 |
- size = hdr[0]; |
30 |
- csum = hdr[1]; |
31 |
+ size = le32_to_cpu(hdr[0]); |
32 |
+ csum = le32_to_cpu(hdr[1]); |
33 |
|
34 |
data = ((void *)hdr) - size; |
35 |
if ((unsigned long)data < initrd_start) { |
36 |
-- |
37 |
2.29.2 |
38 |
|