Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp478677imn; Wed, 27 Jul 2022 11:19:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uzfxup1ES8AcAk9IRsMMVAxtX35Cying7ycy742zu1LejB7hdmU5eG8boh1nvBJiHFrPEv X-Received: by 2002:a05:6402:34c5:b0:43a:8f90:e643 with SMTP id w5-20020a05640234c500b0043a8f90e643mr24095626edc.88.1658945990379; Wed, 27 Jul 2022 11:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658945990; cv=none; d=google.com; s=arc-20160816; b=YwpEVqHW2WW0pKb/HTXDTucIuilXEzGWntbarLzZwExfplEnmZJLhmCN+huCGp2GQr DryxlePHNn385PjjzF1CAQqeA3Tl0bkp5SX0VTb0I3l7LsR1kHzp/c6ro5hXnURZt/yv jNLA83ekatXCBIlh6PRaZduvq088PzVywW0yJNoj7MUGZo9OaRpWUGpnknVVEqh3stXg UMO4XEJ0hJUz2nUF4E+MWJe/vLpjvpsosdpwrEwrPg/8ZoOk+eEjSfOKlvovUK1HESvv c4sedMhDACJ7SQiJel+ZLKetzL/kZoYnAQZDDa4kng6Q/WT5A32Mybiy1t+XSb6uFxp0 EeoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=l0GCuG8rDBZqnlaLcyGX8e+1yGMjgHaFvPyFuQOMTGA=; b=QzAAw9kLVJxr0SicK2tV2gm0q/bLx/7/YY26Sr9tbxCGzD1wyjrbZskp4MQHhKYMnC OTe6fBZEFtPlkLeQ97ULuneJzIQHF+yyMXJHIkcfoqNG7rCzlhVr36x2NFB3Nfi+2LHE YWKjc/e/m4Gq/urydpmHvXznlpPX1Q/ks8tjkg5vQVMDggXGghe/XqOIyImBH5RmGXFs LcP4rraNA9i9/LZB9Rwuxf40x+SvlC4VVkPdWW9TbNA2zxFcoRFPkq6tCueTV+4cMs5l Tfky6bNG6Gh2ijZWTVZtAtEXKQWkmaKALNgT7YdL4jWn2WcsWCupbS1IrrqApIancuS9 5xeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fje+8hyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a11-20020aa7d90b000000b0043ccf284cdesi790294edr.389.2022.07.27.11.19.25; Wed, 27 Jul 2022 11:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fje+8hyT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239107AbiG0QiQ (ORCPT + 99 others); Wed, 27 Jul 2022 12:38:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238978AbiG0Qh1 (ORCPT ); Wed, 27 Jul 2022 12:37:27 -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 CF51C4D4C6; Wed, 27 Jul 2022 09:28:18 -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 4EBF3B821C6; Wed, 27 Jul 2022 16:28:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90DCFC433D6; Wed, 27 Jul 2022 16:28:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658939296; bh=jsF4LpQm777PxNt5/h+cNChfYSEvUrbp0KZNEszQamk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fje+8hyT/turBQv0zYzffwl5sD8bODcydM1zrSfBLr/fzNdJ+zb5rl6XICb0sNF8H m/P1D5bUgrD0Yaz3uIdATtXYLdbCiT4r499u/sNq6PbiGLD0XHlbqGGcC3hwtHgDJV HUocuAwB5BVTR8B58S130CKJTfpi4dqY8ESi3Bu8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.4 12/87] power/reset: arm-versatile: Fix refcount leak in versatile_reboot_probe Date: Wed, 27 Jul 2022 18:10:05 +0200 Message-Id: <20220727161009.505251459@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727161008.993711844@linuxfoundation.org> References: <20220727161008.993711844@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit 80192eff64eee9b3bc0594a47381937b94b9d65a ] of_find_matching_node_and_match() 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: 0e545f57b708 ("power: reset: driver for the Versatile syscon reboot") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/reset/arm-versatile-reboot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/power/reset/arm-versatile-reboot.c b/drivers/power/reset/arm-versatile-reboot.c index 08d0a07b58ef..c7624d7611a7 100644 --- a/drivers/power/reset/arm-versatile-reboot.c +++ b/drivers/power/reset/arm-versatile-reboot.c @@ -146,6 +146,7 @@ static int __init versatile_reboot_probe(void) versatile_reboot_type = (enum versatile_reboot)reboot_id->data; syscon_regmap = syscon_node_to_regmap(np); + of_node_put(np); if (IS_ERR(syscon_regmap)) return PTR_ERR(syscon_regmap); -- 2.35.1