From nobody Tue Dec 16 16:38:52 2025 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 3D1A5C32793 for ; Fri, 19 Aug 2022 16:21:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352436AbiHSQUz (ORCPT ); Fri, 19 Aug 2022 12:20:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352364AbiHSQQZ (ORCPT ); Fri, 19 Aug 2022 12:16:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C57511156E1; Fri, 19 Aug 2022 08:59:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C1C72B8281E; Fri, 19 Aug 2022 15:59:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D2DDC433C1; Fri, 19 Aug 2022 15:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924772; bh=w3ajHmJFOhAEub8nrPwePEcPTAGm2gxNw+rC+5X+vMQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jjqDoHQ3QZktaPc5I0i+IFqIC87zAYkOlwqTH6iGJiwXYSd/IIW+Lo5yUUcj0NE/d VavGqV/lKHz3YYLvFiLNk2NWcBrkFckMxY8wTAXs1++iIZnwnGy+GHYxNEVrppv8H1 Wva9k1BoIBzHdWKxSu2d42PozwapQhX+UXF6H4Tc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij , Miquel Raynal , Sasha Levin Subject: [PATCH 5.10 276/545] mtd: partitions: Fix refcount leak in parse_redboot_of Date: Fri, 19 Aug 2022 17:40:46 +0200 Message-Id: <20220819153841.681274622@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Miaoqian Lin [ Upstream commit 9f7e62815cf3cbbcb1b8cb21649fb4dfdb3aa016 ] of_get_child_by_name() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 237960880960 ("mtd: partitions: redboot: seek fis-index-block in the= right node") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220526110652.64849-1-linmq006@gma= il.com Signed-off-by: Sasha Levin --- drivers/mtd/parsers/redboot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/parsers/redboot.c b/drivers/mtd/parsers/redboot.c index 3ccd6363ee8c..4f3bcc59a638 100644 --- a/drivers/mtd/parsers/redboot.c +++ b/drivers/mtd/parsers/redboot.c @@ -58,6 +58,7 @@ static void parse_redboot_of(struct mtd_info *master) return; =20 ret =3D of_property_read_u32(npart, "fis-index-block", &dirblock); + of_node_put(npart); if (ret) return; =20 --=20 2.35.1