diff mbox series

[v2] soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()

Message ID 20200923113142.GC1473821@mwanda (mailing list archive)
State Accepted
Commit 697f4c621f13babcb7b6c2bef3182e12cdc6c43d
Delegated to: Geert Uytterhoeven
Headers show
Series [v2] soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains() | expand

Commit Message

Dan Carpenter Sept. 23, 2020, 11:31 a.m. UTC
This code needs to call iounmap() on one error path.

Fixes: 2173fc7cb681 ("ARM: shmobile: R-Mobile: Add DT support for PM domains")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2:  The v1 patch potentially led to a use after free.

 drivers/soc/renesas/rmobile-sysc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Geert Uytterhoeven Sept. 24, 2020, 7:35 a.m. UTC | #1
On Wed, Sep 23, 2020 at 1:31 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> This code needs to call iounmap() on one error path.
>
> Fixes: 2173fc7cb681 ("ARM: shmobile: R-Mobile: Add DT support for PM domains")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2:  The v1 patch potentially led to a use after free.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v5.11.

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c
index 54b616ad4a62..beb1c7211c3d 100644
--- a/drivers/soc/renesas/rmobile-sysc.c
+++ b/drivers/soc/renesas/rmobile-sysc.c
@@ -327,6 +327,7 @@  static int __init rmobile_init_pm_domains(void)
 
 		pmd = of_get_child_by_name(np, "pm-domains");
 		if (!pmd) {
+			iounmap(base);
 			pr_warn("%pOF lacks pm-domains node\n", np);
 			continue;
 		}