diff options
author | Luca Stefani <luca@osomprivacy.com> | 2022-12-22 16:10:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-04 13:28:59 +0300 |
commit | 5c3a4cdc53639f08929f3400b26e01e28f175bd2 (patch) | |
tree | 9aafe70312cd24f5b0b94ccacf93ddd90089358a | |
parent | 2cec280c491547e5d15a741aa66128650b97242f (diff) | |
download | linux-5c3a4cdc53639f08929f3400b26e01e28f175bd2.tar.xz |
pstore: Properly assign mem_type property
commit beca3e311a49cd3c55a056096531737d7afa4361 upstream.
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: stable@vger.kernel.org
Signed-off-by: Luca Stefani <luca@osomprivacy.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20221222131049.286288-1-luca@osomprivacy.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/pstore/ram.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 74e4d93f3e08..f3fa3625d772 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -670,7 +670,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); |