diff mbox series

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

Message ID 20221018145651.1975792-2-yangyingliang@huawei.com
State New
Headers show
Series [1/2] fsi: master-hub: fix possible memory leak in hub_master_probe() | expand

Commit Message

Yang Yingliang Oct. 18, 2022, 2:56 p.m. UTC
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@huawei.com>
---
 drivers/fsi/fsi-master-hub.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

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,