[PATCH 2/2] soc/tegra: bpmp: Actually free memory on error path
From: Mikko Perttunen
Date: Wed Mar 01 2023 - 08:48:13 EST
From: Mikko Perttunen <mperttunen@xxxxxxxxxx>
Within the error path, genpd->domains has not been set, so we need
to pass the domains variable to kfree instead.
Signed-off-by: Mikko Perttunen <mperttunen@xxxxxxxxxx>
---
drivers/soc/tegra/powergate-bpmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/tegra/powergate-bpmp.c b/drivers/soc/tegra/powergate-bpmp.c
index 8eaf50d0b6af..179ed895c279 100644
--- a/drivers/soc/tegra/powergate-bpmp.c
+++ b/drivers/soc/tegra/powergate-bpmp.c
@@ -286,7 +286,7 @@ static int tegra_bpmp_add_powergates(struct tegra_bpmp *bpmp,
tegra_powergate_remove(powergate);
}
- kfree(genpd->domains);
+ kfree(domains);
return err;
}
--
2.39.2