Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090247rwb; Mon, 15 Aug 2022 17:53:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR4gK4OTf9GW1ACtJaajZ7rb+/eKGdA8VIUXPA9cqAhLCYf894ZbFh85HKEZpZnrzKsUda4R X-Received: by 2002:a17:906:9b84:b0:738:68f0:3549 with SMTP id dd4-20020a1709069b8400b0073868f03549mr2698144ejc.513.1660611199512; Mon, 15 Aug 2022 17:53:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611199; cv=none; d=google.com; s=arc-20160816; b=GHKGKryEYFIkcxnyL1tUNhjEbcWHxLnjg6dkXtr/hLB4ShkKEMNvIHZHoJVam7F+c7 O4Tw34q9v3Lb6rpd079YEQbCxtLtbNFoBhwL2hhks3+jGllAgjf/ctUagYT7vz+yzZzN Ph+yFTtg/GD/ZjJ20h4SnMHvjYaeBHvf5sEpDBTn/TUwy7bevQYB7KLtM2NqwZrgSNLF F+QBb/nhciPMRCZ15hrMMErhIyEbVKy/WpEx+QLWQ9767d6vu9gsG/5lQVrdwX3E397I FySrahbqmyciF5VyKMHyO/dOChMS5TU/ERt4Pfn2tANJIT0yGSoY/rjWDUA+NYVc7llC Gduw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0u9Cd7HxM1ru8iWSb/wtkDQen/WTjseuULoXaQn2Pj8=; b=COh8h/9dbLGR5BVdIQw4DAZM+GJjdZSo1pnirCEl9wBlOct21xpwnV5EgSBm5fq8tc MQgxDnHod/Uubb5W5VfLG2t65zb+4Dx2sfM0jmyvVNVwirdhFrBmXjMv/TjrfvVmLz/r WUXKbZVK+Xn1BRLRg6fFECF+oOuQmGgYMY7dIaCJz4rSt9OfrKn5buTMs3cgNT4zmUAh 4UtWrEbh1O8ilcOz4APUZ8mWHcY5zyixkz37pB8ERGl/nyRyQNedGUyzWllpdp8J3ujO fpXSAiG3j5PW3WhgL1MRiUCg2RLQF8yAitopZ1m/Y9cN5SiNAtObNzLKg3cd171sogrf zi4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fUReZ50f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh34-20020a1709076ea200b007317ad1f9a4si10041701ejc.310.2022.08.15.17.52.53; Mon, 15 Aug 2022 17:53:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fUReZ50f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352569AbiHOW76 (ORCPT + 99 others); Mon, 15 Aug 2022 18:59:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352461AbiHOW6c (ORCPT ); Mon, 15 Aug 2022 18:58:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A06375FD5; Mon, 15 Aug 2022 12:56:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A797A60FB5; Mon, 15 Aug 2022 19:56:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0C1DC433C1; Mon, 15 Aug 2022 19:56:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593385; bh=vep4ycP0V4FffTk9DpsuDGT1Dir7m6EzFiRNUMoPxTA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fUReZ50fiPmC1gCxID0zB83rzO26n2gKST/b2h02IU5i+VWSZ7xuEw+EH1jl6d5mx 7Tf8F+9SBQQOMAd5pf5j3ApxL3Iw0gQ3DRqBMRjFI4AbmtJ1eZsbctodkebw4pJ+WV 4WkYqEkb3rWoBPNNcOZRL6ewKfUo4Q4K9r4D2btw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Michael Ellerman , Sasha Levin Subject: [PATCH 5.18 0938/1095] powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address Date: Mon, 15 Aug 2022 20:05:37 +0200 Message-Id: <20220815180508.011278501@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Miaoqian Lin [ Upstream commit df5d4b616ee76abc97e5bd348e22659c2b095b1c ] of_get_next_parent() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() in the error path to avoid refcount leak. Fixes: ce21b3c9648a ("[CELL] add support for MSI on Axon-based Cell systems") Signed-off-by: Miaoqian Lin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220605065129.63906-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/cell/axon_msi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 354a58c1e6f2..dba34f4d5162 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -223,6 +223,7 @@ static int setup_msi_msg_address(struct pci_dev *dev, struct msi_msg *msg) if (!prop) { dev_dbg(&dev->dev, "axon_msi: no msi-address-(32|64) properties found\n"); + of_node_put(dn); return -ENOENT; } -- 2.35.1