diff options
author | Evgeny Bachinin <[email protected]> | 2023-11-08 15:56:04 +0300 |
---|---|---|
committer | Neil Armstrong <[email protected]> | 2023-11-27 09:17:51 +0100 |
commit | d8385d7433f9c7d718448465e30d6b8c1207b59f (patch) | |
tree | ca652054f152d086048f76bb712a550a462d7043 | |
parent | d397965e584e0f2c6193b927c1e7693d514a6738 (diff) |
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/[email protected]/
[2] https://lore.kernel.org/linux-amlogic/[email protected]/
Fixes: 0789724f86a5 ("firmware: meson_sm: Add serial number sysfs entry")
Signed-off-by: Evgeny Bachinin <[email protected]>
Acked-by: Neil Armstrong <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Neil Armstrong <[email protected]>
-rw-r--r-- | drivers/firmware/meson/meson_sm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/meson_sm.c index fb766e40a631..5d7f62fe1d5f 100644 --- a/drivers/firmware/meson/meson_sm.c +++ b/drivers/firmware/meson/meson_sm.c @@ -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; |