1 From bb9550704501513f1b09934e57953a2d042ec9c6 Mon Sep 17 00:00:00 2001
2 From: Julia Lawall <julia.lawall@lip6.fr>
3 Date: Mon, 14 Jan 2019 17:44:56 +0100
4 Subject: drm: rcar-du: add missing of_node_put
6 [ Upstream commit 4c6d8fc20b09f9684743afd72e4dbc3f15524479 ]
8 Add an of_node_put when the result of of_graph_get_remote_port_parent is
11 Add a second of_node_put if no encoder is selected (encoder remains NULL).
13 The semantic match that finds the first problem is as follows
14 (http://coccinelle.lip6.fr):
21 e = of_graph_get_remote_port_parent(...);
23 when != true e == NULL
24 when != of_node_put(e)
25 when != of_fwnode_handle(e)
33 Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
34 Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
35 Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
36 Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
37 Signed-off-by: Sasha Levin <sashal@kernel.org>
39 drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 ++
40 1 file changed, 2 insertions(+)
42 diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
43 index fb46df56f0c4..0386b454e221 100644
44 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
45 +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
46 @@ -300,6 +300,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu,
48 "connected entity %pOF is disabled, skipping\n",
50 + of_node_put(entity);
54 @@ -335,6 +336,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu,
56 "no encoder found for endpoint %pOF, skipping\n",
58 + of_node_put(entity);