Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp447697iog; Mon, 13 Jun 2022 06:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz56zurbdTUDSrQbA9gZqdz3CSrofc/eSi//W9ofpNS45mK4c1CPHBFzscbxj1bUR9reOz6 X-Received: by 2002:a05:6402:149:b0:431:7dde:9b59 with SMTP id s9-20020a056402014900b004317dde9b59mr37449838edu.339.1655125680339; Mon, 13 Jun 2022 06:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125680; cv=none; d=google.com; s=arc-20160816; b=VuLxj/D7NE3L0rcuREYthq+6ODgEijz+rRXRWsN9jR+mhh3ZA5LzZjGC2AOrV8IXAf KJemTO6amiJ8IO98VWMKHh5a5/p840h06PlcueutiSpMYbMac27WEIeRuuh5F2FMOkxs jXBLLfxLcu9PXWCGpLqkqnWv4aENTuCAlvZjzzNjCaEVVRMeDcheNKpVPCL75sEVg2NW lG0DYvsF+08vrptafsAtkJDwsuQwnkDq2myZvr5m0qP10C8/Yi6rZ5R5G3I5sg/cJIwt e8jLV4M6UWoAqC+FwM6cIoIj3H2Y6zAURFq4tM/VEsIQK49eJQFHL7goy9TO9bE/W4M2 AaAg== 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=nIGHw8a3uWjKhacp5+OCFrvAbx5rZ5oEYWDFDEOKXH0=; b=ZTdyEgxxLBjia6GVTDsJCf1aJu0hW+5u1qGKsF+IBFzVq4xwrMc5QKg16iPoBdOLh+ rw5DJ8NDUuNoh3T8JFPqQ3DZrJJKTBie0XH92Znc4h1sVF87o/ZLifkG1zBTbImBlU4L 7Pu/mrVjgaNc/w4rKmFZMRpyvI4gu4IXQ1l7LNe4iPAuINypGDGxnCzJMVWd6piW5h2M uRuVYFy7PBcddZcGoy3jOT0XvhD2E3o6mh00sNu1TCwMnoemfhsSkpkP1Ly19zFUWkZp RTKiF8RwqId0ZXVvXYpMs6Nf98DyXu8DgMDKMR102Kt0K0G7KVfmeiPMhPGDNVVp54v1 TIKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JSK5jsaa; 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 hu8-20020a170907a08800b006fedeb20701si8299099ejc.977.2022.06.13.06.07.32; Mon, 13 Jun 2022 06:08:00 -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=JSK5jsaa; 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 S1355565AbiFMLjQ (ORCPT + 99 others); Mon, 13 Jun 2022 07:39:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354830AbiFMLaM (ORCPT ); Mon, 13 Jun 2022 07:30:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE1983FBDE; Mon, 13 Jun 2022 03:45:49 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 48A2361248; Mon, 13 Jun 2022 10:45:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55AF1C34114; Mon, 13 Jun 2022 10:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117148; bh=/lWHFpte0nQhGTo7XI8GUdlZRuC2Mn0hannG7wMM4LU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JSK5jsaarZ7GpSYuiETkUSEGJMSCVAcwJGNtubVqVcZXhWapn9ZuWYUh+du8r7U/6 2hhPejOBz8aLn3/w7qGdl14KaEZklsvCdseOCMQGcjTHqD0SnBmKt2GZCopPlnJd3R 4jhPVPRqCcDxYheGVeJpyB4PSYjRFikAsxseJTDM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Heiko Stuebner , Sasha Levin Subject: [PATCH 5.4 303/411] soc: rockchip: Fix refcount leak in rockchip_grf_init Date: Mon, 13 Jun 2022 12:09:36 +0200 Message-Id: <20220613094937.839141064@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@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=-8.3 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,T_SCC_BODY_TEXT_LINE 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 9b59588d8be91c96bfb0371e912ceb4f16315dbf ] of_find_matching_node_and_match returns a node pointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: 4c58063d4258 ("soc: rockchip: add driver handling grf setup") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220516072013.19731-1-linmq006@gmail.com Signed-off-by: Heiko Stuebner Signed-off-by: Sasha Levin --- drivers/soc/rockchip/grf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c index 494cf2b5bf7b..343ff61ccccb 100644 --- a/drivers/soc/rockchip/grf.c +++ b/drivers/soc/rockchip/grf.c @@ -148,12 +148,14 @@ static int __init rockchip_grf_init(void) return -ENODEV; if (!match || !match->data) { pr_err("%s: missing grf data\n", __func__); + of_node_put(np); return -EINVAL; } grf_info = match->data; grf = syscon_node_to_regmap(np); + of_node_put(np); if (IS_ERR(grf)) { pr_err("%s: could not get grf syscon\n", __func__); return PTR_ERR(grf); -- 2.35.1