* [PATCH] media: i2c: tda1997x: Call of_node_put(ep) only once in tda1997x_parse_dt()
@ 2024-10-03 19:46 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2024-10-03 19:46 UTC (permalink / raw)
To: linux-media, Hans Verkuil, Mauro Carvalho Chehab, Tim Harvey
Cc: LKML, kernel-janitors, Javier Carrasco
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 3 Oct 2024 21:38:45 +0200
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>
---
drivers/media/i2c/tda1997x.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/tda1997x.c b/drivers/media/i2c/tda1997x.c
index 3b7e5ff5b010..959590afc80f 100644
--- a/drivers/media/i2c/tda1997x.c
+++ b/drivers/media/i2c/tda1997x.c
@@ -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 */
--
2.46.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-10-03 19:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-03 19:46 [PATCH] media: i2c: tda1997x: Call of_node_put(ep) only once in tda1997x_parse_dt() Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®