]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: ti-vpe: fix leaked of_node references
authorWen Yang <wen.yang99@zte.com.cn>
Fri, 28 Jun 2019 03:01:16 +0000 (23:01 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 23 Jul 2019 15:43:38 +0000 (11:43 -0400)
The call to of_get_parent returns a node pointer with refcount
incremented thus it must be explicitly decremented after the last
usage.

Detected by coccinelle with the following warnings:
drivers/media/platform/ti-vpe/cal.c:1621:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1607, but without a corresponding object release within this function.

Signed-off-by: Wen Yang <wen.yang99@zte.com.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/ti-vpe/cal.c

index 78cdbd671dd595447a2c3c8350997ef152aca73a..223161f9c4036b2fd7d3dc7df3dd10913f7b83db 100644 (file)
@@ -1612,6 +1612,7 @@ of_get_next_port(const struct device_node *parent,
                        }
                        prev = port;
                } while (!of_node_name_eq(port, "port"));
+               of_node_put(ports);
        }
 
        return port;