From patchwork Mon Dec 28 12:51:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 354834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8607C433E9 for ; Mon, 28 Dec 2020 14:37:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C64B2063A for ; Mon, 28 Dec 2020 14:37:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392235AbgL1OhV (ORCPT ); Mon, 28 Dec 2020 09:37:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:40690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504774AbgL1Ocm (ORCPT ); Mon, 28 Dec 2020 09:32:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8355220739; Mon, 28 Dec 2020 14:32:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165922; bh=Z8Kcy0ZJWO6UT2FhKqTFgdUpl7TCqwLddwe/UT+spO0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XDgEpY5m6f0pruJY+mHTnNma+2sxdmFTi9RRYvtKw4YYM3dCNUam++bDegVe6iQRV XK5EIDw/TIxaoUkipqEFFpFQYaEj87lXpnUmUONyedKcvj2Bn5QXgyWl32SJAklcMd rEXPLQk/+jgsjJMhKItVgLSKVN3ksqjqpDpOfxvY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavel Machek , Lad Prabhakar , Sergei Shtylyov , Geert Uytterhoeven , Krzysztof Kozlowski Subject: [PATCH 5.10 702/717] memory: renesas-rpc-if: Fix a node reference leak in rpcif_probe() Date: Mon, 28 Dec 2020 13:51:40 +0100 Message-Id: <20201228125054.616851738@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Lad Prabhakar commit 4e6b86b409f9fc63fedb39d6e3a0202c4b0244ce upstream. 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 Reviewed-by: Sergei Shtylyov Reviewed-by: Geert Uytterhoeven Reviewed-by: Pavel Machek (CIP) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20201126191146.8753-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Greg Kroah-Hartman --- drivers/memory/renesas-rpc-if.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -560,9 +560,11 @@ static int rpcif_probe(struct platform_d } 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)