Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1156242pxu; Fri, 27 Nov 2020 00:42:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVayRamN3emAYKyCrWalkExEybnMNyDmThG92JFxo6a1ab13lV4xdIKvx0QOaFaW8XgdVv X-Received: by 2002:a17:906:ce41:: with SMTP id se1mr6578348ejb.155.1606466545527; Fri, 27 Nov 2020 00:42:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606466545; cv=none; d=google.com; s=arc-20160816; b=xniweWwUJJLD/nUsQ1/jKMKbO/5dSxd1zAImqKSa9a4Ab2juhK5bM3zwlIfWmIugVo nJySWJ5Bd7c7gzNCbl4AGiYgsF9NPrr7YQVMcgTle5CJ7DzjVkf5g+DoNB7l1V371sxa PsEbcK4n5guXPlnv8/Fr/0KmelZzZAMnGb7hEUcSsNuc/onxKyW41QaVUK7L9tBc45TR MF+IPH4aKyl/N7GDPuma5lRV2TGaw1bDkpgWXfkuglPaexDVoQs9RZAq4Osa0UukWYH9 QDz5AVwViGGGkE/Id11BNer5hpL82+ViNHnO5SbsnannOgAgj9RUYFPQlZqtqJvhswlW TBXA== 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=ZmWDimPZUSxVSnvGvWasDv2vLdx2fOqSdei0Z5oHgz0=; b=LoVb9ehB7K8u2xIA7kRw3rXMyHEwGqhHZFysUH/E0SqYez0Rk8S8f/I7eee5oWM3y4 iYsj3vrhGPru7n8slYIN66A0hSucAnLk2o0hmPCzhaRKqusRmeSMPS2geGLRw19dqLm8 oQmmsvmjMzBNYr2MwKY17VIDAaWcgtEpVSNeaIJiiDouhAPcztUFB3Wsp4YqRhKHeVHe Xkx0hcCRMhOTG3VtV+i79dn2zPc5KVXArD01vUMZRlap8cvkY6EIeg+YYWenaBSLiCQq 2ZokTewWdW7Yv9kYRIyiu3zXSn7JT8Sf6rDKM5I7yRmwZv87rhFuohWrA9+cPuxgBw0l 6p4Q== 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 se21si4601553ejb.453.2020.11.27.00.42.03; Fri, 27 Nov 2020 00:42:25 -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 S2405226AbgKZTMC (ORCPT + 99 others); Thu, 26 Nov 2020 14:12:02 -0500 Received: from relmlor1.renesas.com ([210.160.252.171]:49537 "EHLO relmlie5.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2405176AbgKZTMC (ORCPT ); Thu, 26 Nov 2020 14:12:02 -0500 X-IronPort-AV: E=Sophos;i="5.78,372,1599490800"; d="scan'208";a="64008835" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 27 Nov 2020 04:12:01 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 1E57E40F8AE0; Fri, 27 Nov 2020 04:11:58 +0900 (JST) From: Lad Prabhakar To: Sergei Shtylyov , Krzysztof Kozlowski , Philipp Zabel , Jiri Kosina , Mark Brown , linux-renesas-soc@vger.kernel.org, Pavel Machek , Geert Uytterhoeven Cc: linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar , stable@vger.kernel.org Subject: [PATCH v2 3/5] memory: renesas-rpc-if: Fix a reference leak in rpcif_probe() Date: Thu, 26 Nov 2020 19:11:44 +0000 Message-Id: <20201126191146.8753-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201126191146.8753-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20201126191146.8753-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 Reviewed-by: Sergei Shtylyov --- 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 a8d0ba368625..da0fdb4c7595 100644 --- a/drivers/memory/renesas-rpc-if.c +++ b/drivers/memory/renesas-rpc-if.c @@ -561,9 +561,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.25.1