Skip to contentSkip to conversation

gpu: ipu-v3: fix refcount leak in ipu_add_client_devices()

PATCH New Wang Yufen 1 participant 1 message Dec 4, 2022

Subsystems (2)
lore
Share & tools
lore

Wang Yufen

author
#0 lore raw

PATCH 1/1 gpu: ipu-v3: fix refcount leak in ipu_add_client_devices()

The node returned by of_graph_get_port_by_id() with refcount incremented, of_node_put() needs be called when finish using it. So add it in the error path in ipu_add_client_devices().

Fixes 17e052175039 ("gpu: ipu-v3: Do not bail out on missing optional port nodes")
---
 drivers/gpu/ipu-v3/ipu-common.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/ipu-v3/ipu-common.c +1 -0
index 1183185..80587f5 100644
@@ -1164,6 +1164,7 @@ static int ipu_add_client_devices(struct ipu_soc *ipu, unsigned long ipu_base)
 
 		pdev = platform_device_alloc(reg->name, id++);
 		if (!pdev) {
+			of_node_put(of_node);
 			ret = -ENOMEM;
 			goto err_register;
 		}
Signature · 1 line
1.8.3.1