Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1561465pxu; Tue, 24 Nov 2020 03:32:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfxmm77v4MxTXB13ljGgwt72LgQAqJSyppJ8nGeIS3g4DAJmvbOkMeQKcnfTjJNbFrnpUm X-Received: by 2002:a50:c19a:: with SMTP id m26mr3352493edf.302.1606217523315; Tue, 24 Nov 2020 03:32:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606217523; cv=none; d=google.com; s=arc-20160816; b=hq43RJUwlRGk1YY6R2zV9J5Tmu5nlHnY68mR7lW1Pa61EDkwhAEXx3BDcGRrrRBMRl 5xicjt5Op2Cfo1QTpL8wLLZC7d9t1F4lVq9uFuKFNPs3zkEjNlN6YNz62meyai5Lug0b rpY5IGuyFV/niXoSfxBdC/anNdCoMvddI3PvWb93Y4v5qUmwcVTl+Bw2QlzH7ip/i5JV sTpRL4AmZP+hhnnX0S3mdM53VzrnPO2fcw5BpVdv1n9MB6CQP4WIlCruDgA3pIGlG6B/ pZ820j4N4LQyJgNbMTnhbyxKXvJlVrCoJhiUpK+NYYsTcidSH176uXJrIHnuEMuM6KAb kulg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=WZ+sNu1T/NI/BSjMz7/w2CknI1jsGHoMb/L53o+JoUY=; b=TsQj0Q2/yXIjxo3xXP2BSbNBxwJM8/v27SzrZcNG17jQ7BTAvZNSHwls5X7D/fUWih FF9Refz6m/2jj+kpyHmLIBca9OEJaev4nm1JdMJRM+IC4WdRP/V34XYmCAad3bN21Dv6 sA6msUOK5aRXTNP5Za228pzzyFkk6pC2MMjQ4Gr+IMI3xrg9/eKEWZEJao8pbGGdqwOR 1CCOK4WZ6Enc4IYyasigDp58B/kD+ftulcyma7sdCjWFyqCUSkeGbqFsp68TdWMA2vc4 Dvz+uSPlC+8Z7keGu2o3T6Q2XRwd9/NSPDUeyUAa9yRzu1+LjqQGNC6CSwBxzkRj3yYK 0ZOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e16si8421501ejh.379.2020.11.24.03.31.40; Tue, 24 Nov 2020 03:32:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732836AbgKXL0T (ORCPT + 99 others); Tue, 24 Nov 2020 06:26:19 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:10210 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732791AbgKXL0T (ORCPT ); Tue, 24 Nov 2020 06:26:19 -0500 X-IronPort-AV: E=Sophos;i="5.78,366,1599490800"; d="scan'208";a="63502464" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 24 Nov 2020 20:26:18 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 3F9774362272; Tue, 24 Nov 2020 20:26:16 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Biju Das , Prabhakar , Lad Prabhakar , stable@vger.kernel.org Subject: [PATCH 5/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Date: Tue, 24 Nov 2020 11:25:52 +0000 Message-Id: <20201124112552.26377-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201124112552.26377-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Release the node reference by calling of_node_put(flash) in the probe. Fixes: ca7d8b980b67f ("memory: add Renesas RPC-IF driver") Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Cc: stable@vger.kernel.org --- drivers/memory/renesas-rpc-if.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c index f5cbc762fda7..99633986ffda 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -548,9 +548,11 @@ static int rpcif_probe(struct platform_device *pdev) } else if (of_device_is_compatible(flash, "cfi-flash")) { name = "rpc-if-hyperflash"; } else { + of_node_put(flash); dev_warn(&pdev->dev, "unknown flash type\n"); return -ENODEV; } + of_node_put(flash); vdev = platform_device_alloc(name, pdev->id); if (!vdev) -- 2.17.1