Skip to content

Commit b50231f

Browse files
elfringhverkuil
authored andcommitted
media: i2c: tda1997x: Call of_node_put(ep) only once in tda1997x_parse_dt()
An of_node_put(ep) call was immediately used after a return value check for a v4l2_fwnode_endpoint_parse() call in this function implementation. Thus call such a function only once instead directly before the check. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
1 parent 223fc68 commit b50231f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/media/i2c/tda1997x.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2315,11 +2315,10 @@ static int tda1997x_parse_dt(struct tda1997x_state *state)
23152315
return -EINVAL;
23162316

23172317
ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg);
2318-
if (ret) {
2319-
of_node_put(ep);
2320-
return ret;
2321-
}
23222318
of_node_put(ep);
2319+
if (ret)
2320+
return ret;
2321+
23232322
pdata->vidout_bus_type = bus_cfg.bus_type;
23242323

23252324
/* polarity of HS/VS/DE */

0 commit comments

Comments
 (0)