From 7d1d982f57843d0b494f903f90be7cb75b572261 Mon Sep 17 00:00:00 2001 From: Luca Stefani Date: Thu, 22 Dec 2022 14:10:49 +0100 Subject: [PATCH] UPSTREAM: 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: 9d843e8fafc7 ("pstore: Add mem_type property DT parsing support") Cc: stable@vger.kernel.org Signed-off-by: Luca Stefani Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20221222131049.286288-1-luca@osomprivacy.com Fixes: 1c4893edfe02 ("FROMGIT: pstore: Add mem_type property DT parsing support") Change-Id: Iea62cd7b26effc158500f097474d4df316285ac4 (cherry picked from commit beca3e311a49cd3c55a056096531737d7afa4361 ) Signed-off-by: Luca Stefani --- fs/pstore/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 7183fe4b5f72..df2950500334 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -679,7 +679,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);