[PATCH] firmware: tegra: bpmp: Fix freeing uninitialized pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Like commit 90ca6956d383 ("ice: Fix freeing uninitialized pointers"),
automatically cleaned up pointers need to be initialized before exiting their scope.
Additionally, device_node() should be replaced with a proper freeing
free function of_node_put() in this case.
And the pointer need to be initialized to NULL before any return statement.

Fixes: 8812b8689ee6 ("firmware: tegra: bpmp: Use scoped device node handling to simplify error paths")
Signed-off-by: Zichen Xie <zichenxie0106@xxxxxxxxx>
Reported-by: Zichen Xie <zichenxie0106@xxxxxxxxx>
Reported-by: Zijie Zhao <zzjas98@xxxxxxxxx>
Reported-by: Chenyuan Yang <chenyuan0y@xxxxxxxxx>
---
 drivers/firmware/tegra/bpmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c
index 2bee6e918f81..b365995364fb 100644
--- a/drivers/firmware/tegra/bpmp.c
+++ b/drivers/firmware/tegra/bpmp.c
@@ -35,7 +35,7 @@ channel_to_ops(struct tegra_bpmp_channel *channel)
 
 struct tegra_bpmp *tegra_bpmp_get(struct device *dev)
 {
-	struct device_node *np __free(device_node);
+	struct device_node *np __free(of_node_put) = NULL;
 	struct platform_device *pdev;
 	struct tegra_bpmp *bpmp;
 
-- 
2.25.1





[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux