Skip to content

Commit

Permalink
media: i2c: tda1997x: Call of_node_put(ep) only once in tda1997x_pars…
Browse files Browse the repository at this point in the history
…e_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>
  • Loading branch information
Markus Elfring authored and Hans Verkuil committed Mar 6, 2025
1 parent 223fc68 commit b50231f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/media/i2c/tda1997x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2315,11 +2315,10 @@ static int tda1997x_parse_dt(struct tda1997x_state *state)
return -EINVAL;

ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(ep), &bus_cfg);
if (ret) {
of_node_put(ep);
return ret;
}
of_node_put(ep);
if (ret)
return ret;

pdata->vidout_bus_type = bus_cfg.bus_type;

/* polarity of HS/VS/DE */
Expand Down

0 comments on commit b50231f

Please sign in to comment.