mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:38:03 +00:00
spi: wpcm-fiu: Fix uninitialized res
The second platform_get_resource_byname() can not be replaced with
devm_platform_ioremap_resource_byname(), because the intermediate "res"
is used by resource_size() later.
Fixes: 3bf2a5359b
("spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname()")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20240826132544.3463616-2-ruanjinjie@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2fe6102bf0
commit
0f2cf3bc47
@ -458,7 +458,8 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
|
||||
if (IS_ERR(fiu->clk))
|
||||
return PTR_ERR(fiu->clk);
|
||||
|
||||
fiu->memory = devm_platform_ioremap_resource_byname(pdev, "memory");
|
||||
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
|
||||
fiu->memory = devm_ioremap_resource(dev, res);
|
||||
fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL);
|
||||
if (IS_ERR(fiu->memory)) {
|
||||
dev_err(dev, "Failed to map flash memory window\n");
|
||||
|
Loading…
Reference in New Issue
Block a user