[PATCH 2/2] fsi: master-hub: fix node refcount leak

Yang Yingliang yangyingliang at huawei.com
Wed Oct 19 01:56:51 AEDT 2022


The node refcount is hold in hub_master_probe(), it need be put in
error path in hub_master_probe().

Fixes: f6a2f8eb73f0 ("fsi: Match fsi slaves and engines to available dt nodes")
Signed-off-by: Yang Yingliang <yangyingliang at huawei.com>
---
 drivers/fsi/fsi-master-hub.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/fsi/fsi-master-hub.c b/drivers/fsi/fsi-master-hub.c
index b6f5833f2ee1..632a6fee1d96 100644
--- a/drivers/fsi/fsi-master-hub.c
+++ b/drivers/fsi/fsi-master-hub.c
@@ -254,6 +254,7 @@ static int hub_master_probe(struct device *dev)
 	return 0;
 
 err_register:
+	of_node_put(hub->master.dev.of_node);
 	put_device(&hub->master.dev);
 err_release:
 	fsi_slave_release_range(fsi_dev->slave, FSI_HUB_LINK_OFFSET,
-- 
2.25.1



More information about the linux-fsi mailing list