]> Git Repo - linux.git/commitdiff
pstore: Properly assign mem_type property
authorLuca Stefani <[email protected]>
Thu, 22 Dec 2022 13:10:49 +0000 (14:10 +0100)
committerKees Cook <[email protected]>
Fri, 23 Dec 2022 18:34:25 +0000 (10:34 -0800)
If mem-type is specified in the device tree
it would end up overriding the record_size
field instead of populating mem_type.

As record_size is currently parsed after the
improper assignment with default size 0 it
continued to work as expected regardless of the
value found in the device tree.

Simply changing the target field of the struct
is enough to get mem-type working as expected.

Fixes: 9d843e8fafc7 ("pstore: Add mem_type property DT parsing support")
Cc: [email protected]
Signed-off-by: Luca Stefani <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
fs/pstore/ram.c

index 9a5052431fd36be23190cc9e109dddb441f443d0..ade66dbe5f396cf2ffd8e54a2e3f4b358f1bc28e 100644 (file)
@@ -680,7 +680,7 @@ static int ramoops_parse_dt(struct platform_device *pdev,
                field = value;                                          \
        }
 
-       parse_u32("mem-type", pdata->record_size, pdata->mem_type);
+       parse_u32("mem-type", pdata->mem_type, pdata->mem_type);
        parse_u32("record-size", pdata->record_size, 0);
        parse_u32("console-size", pdata->console_size, 0);
        parse_u32("ftrace-size", pdata->ftrace_size, 0);
This page took 0.056351 seconds and 4 git commands to generate.