LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset()
@ 2023-06-02  2:05 Kunihiko Hayashi
  2023-06-09 22:12 ` Rob Herring
  0 siblings, 1 reply; 2+ messages in thread
From: Kunihiko Hayashi @ 2023-06-02  2:05 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand; +Cc: devicetree, linux-kernel, Kunihiko Hayashi

In init_overlay_changeset(), the variable "node" is from
of_get_child_by_name(), and the "node" should be discarded in error case.

Fixes: d1651b03c2df ("of: overlay: add overlay symbols to live device tree")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/of/overlay.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 2e01960f1aeb..7feb643f1370 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -811,6 +811,7 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs)
 		if (!fragment->target) {
 			pr_err("symbols in overlay, but not in live tree\n");
 			ret = -EINVAL;
+			of_node_put(node);
 			goto err_out;
 		}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset()
  2023-06-02  2:05 [PATCH] of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset() Kunihiko Hayashi
@ 2023-06-09 22:12 ` Rob Herring
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2023-06-09 22:12 UTC (permalink / raw)
  To: Kunihiko Hayashi; +Cc: linux-kernel, Frank Rowand, Rob Herring, devicetree


On Fri, 02 Jun 2023 11:05:02 +0900, Kunihiko Hayashi wrote:
> In init_overlay_changeset(), the variable "node" is from
> of_get_child_by_name(), and the "node" should be discarded in error case.
> 
> Fixes: d1651b03c2df ("of: overlay: add overlay symbols to live device tree")
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  drivers/of/overlay.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Applied, thanks!


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-09 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02  2:05 [PATCH] of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset() Kunihiko Hayashi
2023-06-09 22:12 ` Rob Herring

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 read-only IMAP folder(s) and NNTP newsgroup(s).