From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 9EDA6C432C3 for ; Tue, 3 Dec 2019 22:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 72CA92084F for ; Tue, 3 Dec 2019 22:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413579; bh=nQfw2bvRLVdTkcx1yOgkN4Nc+XNvTeGBrr7DNoc4GdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VU1EJk1js53qgOzN3EVzOmNQawJussR9BtSKNliH+TKV7t4enNwLAs3zpzJHnEA2i rxhXwyTMpFBgsdBCOVI02ejdgoe179gavhWkUNbJ53KwAUXqqS0ea28Fs6Ck5PjWkC ekbKJPu17xRJvMJ3XKnNQoifvqViHfEMq0FCyftk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730067AbfLCWw6 (ORCPT ); Tue, 3 Dec 2019 17:52:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:45798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729951AbfLCWwu (ORCPT ); Tue, 3 Dec 2019 17:52:50 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 B7C7F20866; Tue, 3 Dec 2019 22:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575413570; bh=nQfw2bvRLVdTkcx1yOgkN4Nc+XNvTeGBrr7DNoc4GdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XQTf8kHRy4cuBIS6xPVeBhQM8YfBFWy3V0C4uR3Ceh/rVT3tVjQDquSQJuL0JTk+e IWySb0G4I33/mmS2KXVouPzR8xF6fBKUQIeuZZDVlnsi0lteOmiEX7gB6Mj9p1XqMX UK+9NRNNhsIgLOtSgR+o7tREQs4fMppzU9B4cLik= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Sasha Levin Subject: [PATCH 4.19 179/321] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Date: Tue, 3 Dec 2019 23:34:05 +0100 Message-Id: <20191203223436.441465025@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203223427.103571230@linuxfoundation.org> References: <20191203223427.103571230@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Ellerman [ Upstream commit 47918bc68b7427e961035949cc1501a864578a69 ] In update_lmb_associativity_index() we lookup dr_node using of_find_node_by_path() which takes a reference for us. In the non-error case we forget to drop the reference. Note that find_aa_index() does modify properties of the node, but doesn't need an extra reference held once it's returned. Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/hotplug-memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index d93ff494e7781..7f86bc3eaadec 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c @@ -202,6 +202,7 @@ static int update_lmb_associativity_index(struct drmem_lmb *lmb) aa_index = find_aa_index(dr_node, ala_prop, lmb_assoc); + of_node_put(dr_node); dlpar_free_cc_nodes(lmb_node); if (aa_index < 0) { -- 2.20.1