Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3095040rwb; Mon, 15 Aug 2022 18:00:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR62cwLVYXxBqJEosv8nbd/UproYKPJTOlkFFk7YIsooniEv8k0RdT4cMEKHuCuHfZeYwgaE X-Received: by 2002:a17:906:974b:b0:733:10e:b940 with SMTP id o11-20020a170906974b00b00733010eb940mr11929882ejy.326.1660611637539; Mon, 15 Aug 2022 18:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611637; cv=none; d=google.com; s=arc-20160816; b=leBtV7KVJwL8/dzAleo3G5IMgyuRdE+Rmi7ZMo++n+YlM/qBmEgWda/NjHrqq8BU7u 6IaAUycP7KH+qsrzAGKAfUZa2ViZ7usVx9wM6jz+5zRi0yAUq74mrNjfaIyhLyfNFoZj i4UifbMeJsllRA+vwCtnkACmJsPBQhXYbVfk4hgjW5obcu+wBr4hBAkyK22FSZb1C33+ kH5bF5vJF1CuNpu2GOvcNcVidHAGRC7PEqvMVJtYotvjG4WP4Car7vZv7bfnHTLGbIWa gSPmVD2yQZobT/U1tAcxVUkTSWvCJWhCzJcwdRIgFJgAEHHdL3zfUsqRztlp/Az557kU Hg/Q== 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=w895iANfvfd03CxkVh3y59jMJJpKQ8Ed5WWTvkbqKLk=; b=aCuTdOw0xJAXcxvlmXVhJYiXNacemkBhpjIaqg2VqktOW9cRK6mVucs+78rtWX5N0k 5JwqUFtlfTlojBQdUT1hBSh+T52t76DeGPcMq0kj5Ewe5lq1fjJ4w3tclTK9t51tfkc9 KXJSh4FlKmQJYHlm0RWtooyq+E5KFlV1g1rsUSeOIgvGpmX9Zcg7j4K8jCrFa/z5/SYA hDH1a8AqOjPgmXqyBbE6yqhMQapV1adAC5MfKqyFCB+aSSwHliBhEPRqY44RlBn8uZZh 7XU5klGGcToGKj1NUuDkdgxtmWxjfre1cj+RIJn6fE/qnTn1GPxEBy9qdn/82xD2uCtP swjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="MVAxp/EL"; 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 hd11-20020a170907968b00b00732f74db437si8085048ejc.891.2022.08.15.18.00.08; Mon, 15 Aug 2022 18:00:37 -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="MVAxp/EL"; 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 S231786AbiHPAyY (ORCPT + 99 others); Mon, 15 Aug 2022 20:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350293AbiHPAqx (ORCPT ); Mon, 15 Aug 2022 20:46:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63C68B6014; Mon, 15 Aug 2022 13:45:33 -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 ams.source.kernel.org (Postfix) with ESMTPS id 9E4F9B80EAD; Mon, 15 Aug 2022 20:45:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D412FC433D6; Mon, 15 Aug 2022 20:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596330; bh=Twa0gzM3qRhyKJMKgVlGB90hzGENGo3dT9+dADTAQRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MVAxp/ELQyzvZy+OltJFhW0gKFSxGcivQqYjqMVVUCpxZka32EjSiY3asABrm2qS0 zwuAbcXW+Tzy8sJVRfFC842ou6cO1R56q5mlgdJrF3vj2gRWIpQOxAeKaM8VIR1A3B AsRnZUQG82h+NKjp60WgTSr5gLD17kiLiIAHltvI= 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.19 1012/1157] powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address Date: Mon, 15 Aug 2022 20:06:08 +0200 Message-Id: <20220815180520.352489382@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 f3291e957a19..5b012abca773 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