From: Kunihiko Hayashi Date: Fri, 2 Jun 2023 02:05:02 +0000 (+0900) Subject: of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset() X-Git-Tag: v6.1.35~157 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=628e40a225a015cb87bbbcb6cd55bc48c44f615b;p=users%2Fdwmw2%2Flinux.git of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset() [ Upstream commit 39affd1fdf65983904fafc07cf607cff737eaf30 ] 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 Link: https://lore.kernel.org/r/20230602020502.11693-1-hayashi.kunihiko@socionext.com Signed-off-by: Rob Herring Signed-off-by: Sasha Levin --- diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index ed4e6c144a681..5289975bad708 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; }