diff mbox series

[2/2] soc/tegra: bpmp: Actually free memory on error path

Message ID 20230301134756.999169-2-cyndis@kapsi.fi
State Accepted
Headers show
Series [1/2] firmware: tegra: bpmp: Fix error paths in debugfs | expand

Commit Message

Mikko Perttunen March 1, 2023, 1:47 p.m. UTC
From: Mikko Perttunen <mperttunen@nvidia.com>

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@nvidia.com>
---
 drivers/soc/tegra/powergate-bpmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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;
 }