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

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

 



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")
Signed-off-by: Wang Yufen <wangyufen@xxxxxxxxxx>
---
 drivers/gpu/ipu-v3/ipu-common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 1183185..80587f5 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -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;
 		}
-- 
1.8.3.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux