* [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of()
@ 2024-11-04 17:16 Dan Carpenter
2024-11-05 16:45 ` Dan Carpenter
2024-11-05 16:59 ` Laurent Pinchart
0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2024-11-04 17:16 UTC (permalink / raw)
To: Kuninori Morimoto
Cc: Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek,
Rob Herring (Arm), Sakari Ailus, Tomi Valkeinen, linux-media,
linux-arm-kernel, linux-kernel, kernel-janitors
This loop was recently converted to use for_each_of_graph_port() which
automatically does __cleanup__ on the "port" iterator variable. Delete
the calls to of_node_put(port) to avoid a double put bug.
Fixes: 393194cdf11e ("media: xilinx-tpg: use new of_graph functions")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/media/platform/xilinx/xilinx-tpg.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c
index cb93711ea3e3..7deec6e37edc 100644
--- a/drivers/media/platform/xilinx/xilinx-tpg.c
+++ b/drivers/media/platform/xilinx/xilinx-tpg.c
@@ -722,7 +722,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
format = xvip_of_get_format(port);
if (IS_ERR(format)) {
dev_err(dev, "invalid format in DT");
- of_node_put(port);
return PTR_ERR(format);
}
@@ -731,7 +730,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg)
xtpg->vip_format = format;
} else if (xtpg->vip_format != format) {
dev_err(dev, "in/out format mismatch in DT");
- of_node_put(port);
return -EINVAL;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of() 2024-11-04 17:16 [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of() Dan Carpenter @ 2024-11-05 16:45 ` Dan Carpenter 2024-11-05 16:59 ` Laurent Pinchart 1 sibling, 0 replies; 5+ messages in thread From: Dan Carpenter @ 2024-11-05 16:45 UTC (permalink / raw) To: Kuninori Morimoto Cc: Laurent Pinchart, Mauro Carvalho Chehab, Michal Simek, Rob Herring (Arm), Sakari Ailus, Tomi Valkeinen, linux-media, linux-arm-kernel, linux-kernel, kernel-janitors On Mon, Nov 04, 2024 at 08:16:19PM +0300, Dan Carpenter wrote: > This loop was recently converted to use for_each_of_graph_port() which > automatically does __cleanup__ on the "port" iterator variable. Delete > the calls to of_node_put(port) to avoid a double put bug. > > Fixes: 393194cdf11e ("media: xilinx-tpg: use new of_graph functions") I guess the CI system applies this to the wrong git tree so it says the of_node_put() calls are necessary and it can't find the Fixes commit. regards, dan carpenter ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of() 2024-11-04 17:16 [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of() Dan Carpenter 2024-11-05 16:45 ` Dan Carpenter @ 2024-11-05 16:59 ` Laurent Pinchart 2025-02-24 8:49 ` Hans Verkuil 1 sibling, 1 reply; 5+ messages in thread From: Laurent Pinchart @ 2024-11-05 16:59 UTC (permalink / raw) To: Dan Carpenter Cc: Kuninori Morimoto, Mauro Carvalho Chehab, Michal Simek, Rob Herring (Arm), Sakari Ailus, Tomi Valkeinen, linux-media, linux-arm-kernel, linux-kernel, kernel-janitors Hi Dan, Thank you for the patch. On Mon, Nov 04, 2024 at 08:16:19PM +0300, Dan Carpenter wrote: > This loop was recently converted to use for_each_of_graph_port() which > automatically does __cleanup__ on the "port" iterator variable. Delete > the calls to of_node_put(port) to avoid a double put bug. > > Fixes: 393194cdf11e ("media: xilinx-tpg: use new of_graph functions") > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> The offending commit wasn't merged through the media tree, so we can't easily merge the fix there either. I'm fine merging this fix through Rob's tree. > --- > drivers/media/platform/xilinx/xilinx-tpg.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c > index cb93711ea3e3..7deec6e37edc 100644 > --- a/drivers/media/platform/xilinx/xilinx-tpg.c > +++ b/drivers/media/platform/xilinx/xilinx-tpg.c > @@ -722,7 +722,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) > format = xvip_of_get_format(port); > if (IS_ERR(format)) { > dev_err(dev, "invalid format in DT"); > - of_node_put(port); > return PTR_ERR(format); > } > > @@ -731,7 +730,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) > xtpg->vip_format = format; > } else if (xtpg->vip_format != format) { > dev_err(dev, "in/out format mismatch in DT"); > - of_node_put(port); > return -EINVAL; > } > -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of() 2024-11-05 16:59 ` Laurent Pinchart @ 2025-02-24 8:49 ` Hans Verkuil 2025-02-24 9:21 ` Laurent Pinchart 0 siblings, 1 reply; 5+ messages in thread From: Hans Verkuil @ 2025-02-24 8:49 UTC (permalink / raw) To: Laurent Pinchart, Dan Carpenter Cc: Kuninori Morimoto, Mauro Carvalho Chehab, Michal Simek, Rob Herring (Arm), Sakari Ailus, Tomi Valkeinen, linux-media, linux-arm-kernel, linux-kernel, kernel-janitors On 05/11/2024 17:59, Laurent Pinchart wrote: > Hi Dan, > > Thank you for the patch. > > On Mon, Nov 04, 2024 at 08:16:19PM +0300, Dan Carpenter wrote: >> This loop was recently converted to use for_each_of_graph_port() which >> automatically does __cleanup__ on the "port" iterator variable. Delete >> the calls to of_node_put(port) to avoid a double put bug. >> >> Fixes: 393194cdf11e ("media: xilinx-tpg: use new of_graph functions") >> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > The offending commit wasn't merged through the media tree, so we can't > easily merge the fix there either. I'm fine merging this fix through > Rob's tree. I don't see this patch merged anywhere. Should I just pick it up? I think it got lost in the noise. The commit 393194cdf11e is now available in our media tree, so it should be fine, I think, if I pick it up. It needs a CC to stable as well, right? I can add that. Regards, Hans > >> --- >> drivers/media/platform/xilinx/xilinx-tpg.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c >> index cb93711ea3e3..7deec6e37edc 100644 >> --- a/drivers/media/platform/xilinx/xilinx-tpg.c >> +++ b/drivers/media/platform/xilinx/xilinx-tpg.c >> @@ -722,7 +722,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) >> format = xvip_of_get_format(port); >> if (IS_ERR(format)) { >> dev_err(dev, "invalid format in DT"); >> - of_node_put(port); >> return PTR_ERR(format); >> } >> >> @@ -731,7 +730,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) >> xtpg->vip_format = format; >> } else if (xtpg->vip_format != format) { >> dev_err(dev, "in/out format mismatch in DT"); >> - of_node_put(port); >> return -EINVAL; >> } >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of() 2025-02-24 8:49 ` Hans Verkuil @ 2025-02-24 9:21 ` Laurent Pinchart 0 siblings, 0 replies; 5+ messages in thread From: Laurent Pinchart @ 2025-02-24 9:21 UTC (permalink / raw) To: Hans Verkuil Cc: Dan Carpenter, Kuninori Morimoto, Mauro Carvalho Chehab, Michal Simek, Rob Herring (Arm), Sakari Ailus, Tomi Valkeinen, linux-media, linux-arm-kernel, linux-kernel, kernel-janitors Hi Hans, On Mon, Feb 24, 2025 at 09:49:47AM +0100, Hans Verkuil wrote: > On 05/11/2024 17:59, Laurent Pinchart wrote: > > Hi Dan, > > > > Thank you for the patch. > > > > On Mon, Nov 04, 2024 at 08:16:19PM +0300, Dan Carpenter wrote: > >> This loop was recently converted to use for_each_of_graph_port() which > >> automatically does __cleanup__ on the "port" iterator variable. Delete > >> the calls to of_node_put(port) to avoid a double put bug. > >> > >> Fixes: 393194cdf11e ("media: xilinx-tpg: use new of_graph functions") > >> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > > > The offending commit wasn't merged through the media tree, so we can't > > easily merge the fix there either. I'm fine merging this fix through > > Rob's tree. > > I don't see this patch merged anywhere. Should I just pick it up? I think > it got lost in the noise. > > The commit 393194cdf11e is now available in our media tree, so it should > be fine, I think, if I pick it up. It needs a CC to stable as well, right? > I can add that. Yes, I'd CC stable. Thank you for handling it. > >> --- > >> drivers/media/platform/xilinx/xilinx-tpg.c | 2 -- > >> 1 file changed, 2 deletions(-) > >> > >> diff --git a/drivers/media/platform/xilinx/xilinx-tpg.c b/drivers/media/platform/xilinx/xilinx-tpg.c > >> index cb93711ea3e3..7deec6e37edc 100644 > >> --- a/drivers/media/platform/xilinx/xilinx-tpg.c > >> +++ b/drivers/media/platform/xilinx/xilinx-tpg.c > >> @@ -722,7 +722,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) > >> format = xvip_of_get_format(port); > >> if (IS_ERR(format)) { > >> dev_err(dev, "invalid format in DT"); > >> - of_node_put(port); > >> return PTR_ERR(format); > >> } > >> > >> @@ -731,7 +730,6 @@ static int xtpg_parse_of(struct xtpg_device *xtpg) > >> xtpg->vip_format = format; > >> } else if (xtpg->vip_format != format) { > >> dev_err(dev, "in/out format mismatch in DT"); > >> - of_node_put(port); > >> return -EINVAL; > >> } > >> -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-02-24 9:42 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-11-04 17:16 [PATCH next] media: xilinx-tpg: fix double put in xtpg_parse_of() Dan Carpenter 2024-11-05 16:45 ` Dan Carpenter 2024-11-05 16:59 ` Laurent Pinchart 2025-02-24 8:49 ` Hans Verkuil 2025-02-24 9:21 ` Laurent Pinchart
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).