Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1865257rwb; Fri, 19 Aug 2022 10:40:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR7nsaT1l6XHQqbzylLOyUxNcZKliHlDDkAgDCbMHPGtB7a3JZwG2Lt/V1u8na8OWor2STWS X-Received: by 2002:a17:902:e748:b0:16f:953e:2770 with SMTP id p8-20020a170902e74800b0016f953e2770mr8264162plf.156.1660930821157; Fri, 19 Aug 2022 10:40:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930821; cv=none; d=google.com; s=arc-20160816; b=etYrgNF4ApEltktffIBqKQ6/PLf0mBmPqErw2pmWNft3iYDKT556t2kj/5VJEnEJRe n78jSJ7GjJvK3uyRGz+Pq1gZTkN4SzY8Ud3oNTbPX0Wnch2j6lnVKXd8KvtGKzGb1IoX +d5Trqz8YDfK2SIVqCS+5iKavZkHx1N6Q5mGa8XezQxfRpcOXdjZsmbcBxjKZrzm4dE0 sxCUfMhhrbrJdq5GwLQQOZGdxqAdcwKKshgJAESVJBcJoWZ9nu7g7GZHWfMzY7EteRmd 18rQm9Bxu2htGmIjBdid1QYJZnMcFS2PKBUnRqT/Xq6NtVbF4XmR4VFZQW6HZXL2nvoQ fJaA== 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=fw8C7ZppD079eBntUCOSUYq7xYo9IHk4n/efd5nLhm4=; b=BkZF1GF+GQ9qidKjq1javceOEsHyganccWU6WuP5qHqawRouZluV7rd9USc7vDmsi1 JHxFigQlhCqLKaW7sa6AR2+0G38CnoWw08ttOjipQQNl3qAWlzTRveu2Ooxq3tykNpIH xzANKVMhBav75g5XxjEaepiPKNySpUeTLutqlLheEYFPGDSnUvZtPjCd8WNhU9qq7Ml7 OkIl6aXF/Rqjk60kAYabSGjUzxalIlzHi5VFDJ2CH43AfBxxBBMT6ZAi4E8Z/T6XzKdi uVEJMOy8du/X0Tl6+oh7ItysvDafOzyHrZUDB3T9tktPlSRYZpOM4B1ip6iK7ZhhVZKG a6mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Q9QWHmg2; 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 n4-20020a654884000000b0041d17e08467si4561830pgs.381.2022.08.19.10.40.10; Fri, 19 Aug 2022 10:40:21 -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=Q9QWHmg2; 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 S1353491AbiHSQh5 (ORCPT + 99 others); Fri, 19 Aug 2022 12:37:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353308AbiHSQfH (ORCPT ); Fri, 19 Aug 2022 12:35:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEFFA120ABE; Fri, 19 Aug 2022 09:07:15 -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 B28F0B8280D; Fri, 19 Aug 2022 16:07:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F926C43140; Fri, 19 Aug 2022 16:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660925221; bh=MR03i1JZYyk9OQZgcuhuGy5D24XzcVoa/kQ4jJNgMY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q9QWHmg2VSOxRp8s3qlK7VpODSrmvaiDBejL/ttnste58+f8AXFLXeS0k0nrwNC/5 aJtCirN5AaC0ehptHTHK6vLoFXzdU6tpWoKTGU/oHfM6lRsu1O4GktvDwI0B2zYgRs UHYj3XQqun5o3E3fb8gELxUdlewfmILfkE/KSCsI= 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.10 423/545] powerpc/cell/axon_msi: Fix refcount leak in setup_msi_msg_address Date: Fri, 19 Aug 2022 17:43:13 +0200 Message-Id: <20220819153848.341961889@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 ca2555b8a0c2..ffbc7d2e9464 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c @@ -226,6 +226,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