Skip to content

Commit beca3e3

Browse files
lucaosomkees
authored andcommitted
pstore: Properly assign mem_type property
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: 9d843e8 ("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]
1 parent 2f4fec5 commit beca3e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/pstore/ram.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ static int ramoops_parse_dt(struct platform_device *pdev,
680680
field = value; \
681681
}
682682

683-
parse_u32("mem-type", pdata->record_size, pdata->mem_type);
683+
parse_u32("mem-type", pdata->mem_type, pdata->mem_type);
684684
parse_u32("record-size", pdata->record_size, 0);
685685
parse_u32("console-size", pdata->console_size, 0);
686686
parse_u32("ftrace-size", pdata->ftrace_size, 0);

0 commit comments

Comments
 (0)