From patchwork Tue Oct 27 13:49:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 313080 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 33A42C55178 for ; Tue, 27 Oct 2020 14:04:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D99F02222C for ; Tue, 27 Oct 2020 14:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807461; bh=R+lkFCQzzaufUJC/QvkrhHlktGaX/olfLwZnyfo/ApM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vJIPOamLx6An2R63JVPU+X60FS1QbXcCds+2j3KHTRzXzwOmcLDsomQBnJh+PTkME KE2B+r2zE22a/By2AZvNEsiJMALTe1A3CoBJsU2gpLxut21a5D5Xk3HZkB7/pi/lw2 tQFSCA+58VOqru3/A9SRIlcPkt7IxIQzFsEX3jM4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754108AbgJ0OET (ORCPT ); Tue, 27 Oct 2020 10:04:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504843AbgJ0OEP (ORCPT ); Tue, 27 Oct 2020 10:04:15 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9189922258; Tue, 27 Oct 2020 14:04:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807455; bh=R+lkFCQzzaufUJC/QvkrhHlktGaX/olfLwZnyfo/ApM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ElTwGtXwrf4huToUlF8AygHLeoCSAj9gBpvoMRZuoDcTGMLa4aZ4wNz4ehk76aASV 7qZDpfOktxZXLnAYd9zkdF7RVVsN6JDMj0JlYqoMdUC3yU598Ruoxrrrmia/QQF1MY psTFWMIr6pR8/q52UKtedlPqfos2g2iuFgpLlEbM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Mc Guire , Michael Ellerman , Sasha Levin Subject: [PATCH 4.9 059/139] powerpc/icp-hv: Fix missing of_node_put() in success path Date: Tue, 27 Oct 2020 14:49:13 +0100 Message-Id: <20201027134904.929942918@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Nicholas Mc Guire [ Upstream commit d3e669f31ec35856f5e85df9224ede5bdbf1bc7b ] Both of_find_compatible_node() and of_find_node_by_type() will return a refcounted node on success - thus for the success path the node must be explicitly released with a of_node_put(). Fixes: 0b05ac6e2480 ("powerpc/xics: Rewrite XICS driver") Signed-off-by: Nicholas Mc Guire Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1530691407-3991-1-git-send-email-hofrat@osadl.org Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/xics/icp-hv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/sysdev/xics/icp-hv.c b/arch/powerpc/sysdev/xics/icp-hv.c index e7fa26c4ff73e..d3a0322ee3276 100644 --- a/arch/powerpc/sysdev/xics/icp-hv.c +++ b/arch/powerpc/sysdev/xics/icp-hv.c @@ -179,6 +179,7 @@ int icp_hv_init(void) icp_ops = &icp_hv_ops; + of_node_put(np); return 0; }