Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp499107imn; Wed, 27 Jul 2022 11:56:16 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uitAJzQQyUmeaa4lOFKn2OipXsB+92x1fo71Lpt23kb5LjhG3/+Pv9hY+udYZYRBf+OEUj X-Received: by 2002:a05:6402:401b:b0:43b:e04b:212b with SMTP id d27-20020a056402401b00b0043be04b212bmr21877083eda.78.1658948176149; Wed, 27 Jul 2022 11:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658948176; cv=none; d=google.com; s=arc-20160816; b=O/SyEPl2vfstLihriIs/h18XDM/iFEypvTiHqDoBCabIF07QQV5FktL67eDp63m6O+ ttJ+d9sPIHkJ19euncOmP7dcn0WaOBs2WtXzhlr7YwbSSFT/6fCRF4OndvAiuMfSoXg3 mGZyprM7JyM6LmcRvLSnXNC39/ofMhZIUR9qK8nFFW/kJjB8TBDd9nOCkZXXnom85s9v gahamC2asmkUePDh3YSNB4XRSMp6f/EpV9Dfl1Q3vro9SwvqJPv2DC7izkZqoSloiBOa p8goPVwAMOnYsULnu0rXvRD7ubsEsuaLVlwP6YIgOumOatoer8hxPUDE26QJK5c5GmfO R6Sw== 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=yn2ABacjfOHeYCXLj+90XZVxXHaOwchaAKQ/z2E29+g=; b=Q7PygVI9kYQZfG0+V8ipyLQNXrzj1Zo/vofwu8246VblZBsT0yjyAqi0gMixHNNJpN ZkKT4ijT4pPWHD1f5oQ0zfym+rIjIOGuJs2XqlhTa/fct5l+X/B5G4Q6S6mAM/fHrFaH rsTNCg8vcql4VJwqz2lbGRBIKGUdwGhPl+RO/oDCWdVqQtTig6Qw35fHfwdUVBT4rbyD DWuThdOUSjWTyoFblT9y7Fn3Je53wfKRFk5VwnKtpEO1AMo75VfOHdBeuLdbsLJYTNxY oCwLENG3asxD4qyZ6+IrSl5IAxQsJ9ppmjpo5XfmSoZid9iqoPQQ2EjcHo7mA7r4IsVL Dp0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KxwUsWxj; 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 b25-20020aa7c919000000b0043cdddef31dsi258196edt.303.2022.07.27.11.55.51; Wed, 27 Jul 2022 11:56:16 -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=KxwUsWxj; 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 S236589AbiG0Qam (ORCPT + 99 others); Wed, 27 Jul 2022 12:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237414AbiG0Q36 (ORCPT ); Wed, 27 Jul 2022 12:29:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F408C2645; Wed, 27 Jul 2022 09:25:09 -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 7D754B821C8; Wed, 27 Jul 2022 16:25:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C56F2C433C1; Wed, 27 Jul 2022 16:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658939108; bh=0ZqCx0f3w4xzVKM7hqpvqH6GcIZzjcZOSWtNS/jyHXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KxwUsWxjZRgnmEijLf3r70Nd71s5NCyDo2MDjdyRMoMRSVFRfjIKr0sQYEJ9MqniG d8w5hRz9nNgbLMIBVt3HGSecFH5w2Str2tFHkq5Ev5hcZ4nHsp3Sf4Ih/chrGN4Koh df/BvJHZeGIojRJnZS2APalXDMK0dcVxq+SCCyoU= 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 4.19 04/62] power/reset: arm-versatile: Fix refcount leak in versatile_reboot_probe Date: Wed, 27 Jul 2022 18:10:13 +0200 Message-Id: <20220727161004.335900070@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220727161004.175638564@linuxfoundation.org> References: <20220727161004.175638564@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 06d34ab47df5..8022c782f6ff 100644 --- a/drivers/power/reset/arm-versatile-reboot.c +++ b/drivers/power/reset/arm-versatile-reboot.c @@ -150,6 +150,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