Skip to content

Commit d8385d7

Browse files
Evgeny Bachininsuperna9999
authored andcommitted
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: 0789724 ("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>
1 parent d397965 commit d8385d7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/firmware/meson/meson_sm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,21 +310,23 @@ static int __init meson_sm_probe(struct platform_device *pdev)
310310
fw->sm_shmem_out_base = meson_sm_map_shmem(chip->cmd_shmem_out_base,
311311
chip->shmem_size);
312312
if (WARN_ON(!fw->sm_shmem_out_base))
313-
goto out_in_base;
313+
goto unmap_in_base;
314314
}
315315

316316
fw->chip = chip;
317317

318318
platform_set_drvdata(pdev, fw);
319319

320320
if (devm_of_platform_populate(dev))
321-
goto out_in_base;
321+
goto unmap_out_base;
322322

323323
pr_info("secure-monitor enabled\n");
324324

325325
return 0;
326326

327-
out_in_base:
327+
unmap_out_base:
328+
iounmap(fw->sm_shmem_out_base);
329+
unmap_in_base:
328330
iounmap(fw->sm_shmem_in_base);
329331
out:
330332
return -EINVAL;

0 commit comments

Comments
 (0)