From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33197EB64D9 for ; Mon, 19 Jun 2023 10:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230526AbjFSKcR (ORCPT ); Mon, 19 Jun 2023 06:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbjFSKcO (ORCPT ); Mon, 19 Jun 2023 06:32:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EECDDCC for ; Mon, 19 Jun 2023 03:32:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8C17B60B78 for ; Mon, 19 Jun 2023 10:32:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 776F7C433C8; Mon, 19 Jun 2023 10:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1687170733; bh=b31AJd8TsvXjiJpSsKYtmGvMn42mhKKqaVZWngsRhlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EGqd5yhlon+cTcaszt8FuUWImu2whJXc5zF/r8xeA9EWvz/oYjZ4i9nZYERb7inm5 23a5X4Y1c5hVBrHxBA0OQ7NC9P0/Kv2nABvwFfRfwSCPr90+pjlTnIfqNOUbdYQ4k3 aMqedwUt4e0dbEEDpqoLEA+FgH/tlhCBhTYQFoA8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kunihiko Hayashi , Rob Herring , Sasha Levin Subject: [PATCH 6.3 008/187] of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset() Date: Mon, 19 Jun 2023 12:27:06 +0200 Message-ID: <20230619102158.023786702@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230619102157.579823843@linuxfoundation.org> References: <20230619102157.579823843@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Kunihiko Hayashi [ 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 --- drivers/of/overlay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 2e01960f1aeb3..7feb643f13707 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.39.2