mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-11-23 10:06:28 +08:00
firmware: meson-sm: unmap out_base shmem in error path
When SM driver was introduced in [1], the code flow did not require
to unmap out_base shmem in case of errors inside probe().
During [2], the additional error path appeared, which requires unmap.
Patch adds iounmap() missed.
Links:
[1] https://lore.kernel.org/linux-amlogic/1466339944-602-2-git-send-email-carlo@caione.org/
[2] https://lore.kernel.org/linux-amlogic/1532613556-5398-1-git-send-email-narmstrong@baylibre.com/
Fixes: 0789724f86
("firmware: meson_sm: Add serial number sysfs entry")
Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20231108125604.162383-3-EABachinin@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This commit is contained in:
parent
d397965e58
commit
d8385d7433
@ -310,7 +310,7 @@ static int __init meson_sm_probe(struct platform_device *pdev)
|
||||
fw->sm_shmem_out_base = meson_sm_map_shmem(chip->cmd_shmem_out_base,
|
||||
chip->shmem_size);
|
||||
if (WARN_ON(!fw->sm_shmem_out_base))
|
||||
goto out_in_base;
|
||||
goto unmap_in_base;
|
||||
}
|
||||
|
||||
fw->chip = chip;
|
||||
@ -318,13 +318,15 @@ static int __init meson_sm_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, fw);
|
||||
|
||||
if (devm_of_platform_populate(dev))
|
||||
goto out_in_base;
|
||||
goto unmap_out_base;
|
||||
|
||||
pr_info("secure-monitor enabled\n");
|
||||
|
||||
return 0;
|
||||
|
||||
out_in_base:
|
||||
unmap_out_base:
|
||||
iounmap(fw->sm_shmem_out_base);
|
||||
unmap_in_base:
|
||||
iounmap(fw->sm_shmem_in_base);
|
||||
out:
|
||||
return -EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user