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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB2E5CCA47A for ; Wed, 8 Jun 2022 20:26:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231590AbiFHU0C (ORCPT ); Wed, 8 Jun 2022 16:26:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbiFHU0A (ORCPT ); Wed, 8 Jun 2022 16:26:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BDF838719D; Wed, 8 Jun 2022 13:26:00 -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 9CB9261CC8; Wed, 8 Jun 2022 20:25:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9AB3C3411C; Wed, 8 Jun 2022 20:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654719959; bh=9n03tEEmAqhGngy9FDlsSxvVhf4oGNgIu1WDM3aPpt8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=MIP/DY9Y9G4P5JHPm50KarY0Kw6xmunpfKz8jD2EgTKriKOeSkhs+925w0zU63F61 b4fRGE078sIH72iILZIGxgI5eI3PePhKhISUuvbT8ufOebpCzW/bMo/EnITikUMzPJ S0Ej0tXoqbKFdKp1dSChRcr3tXHgIZ/ALUJlSthF9ilxlLLBm0f9Ga8TbdG+HYlIpR hJwtdREa0MaddcTf2IgGrxkfVgsX0XTQHUA+Vf6LKpZqBjvzWU2nkK8+awAiPNFkyo T+vebQXxfxJaWv4wDkGovmzh09abgfIQVW93lWYtBDk0BUc+V5q5DmxLZQtHHkcLEO dqDNMkr4LtVkQ== Date: Wed, 8 Jun 2022 15:25:57 -0500 From: Bjorn Helgaas To: Miaoqian Lin Cc: Nicolas Saenz Julienne , Broadcom internal kernel review list , Jim Quinlan , Florian Fainelli , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Marc Zyngier , Andrew Murray , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: brcmstb: Fix refcount leak in brcm_pcie_probe Message-ID: <20220608202557.GA419456@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220603130849.38252-1-linmq006@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 03, 2022 at 05:08:49PM +0400, Miaoqian Lin wrote: > of_parse_phandle() returns a node pointer with refcount > incremented, we should use of_node_put() on it when not need anymore. > Add missing of_node_put() to avoid refcount leak. > > Fixes: 40ca1bf580ef ("PCI: brcmstb: Add MSI support") > Signed-off-by: Miaoqian Lin Applied with Rob's reviewed-by to pci/ctrl/brcmstb for v5.20, thanks! > --- > changes in v2: > - update Fixes tag. > v1 Link: https://lore.kernel.org/r/20220602125003.10723-1-linmq006@gmail.com > --- > drivers/pci/controller/pcie-brcmstb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index 375c0c40bbf8..e3b673441a11 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -1597,8 +1597,10 @@ static int brcm_pcie_probe(struct platform_device *pdev) > ret = brcm_pcie_enable_msi(pcie); > if (ret) { > dev_err(pcie->dev, "probe of internal MSI failed"); > + of_node_put(msi_np); > goto fail; > } > + of_node_put(msi_np); > } > > bridge->ops = pcie->type == BCM7425 ? &brcm_pcie_ops32 : &brcm_pcie_ops; > -- > 2.25.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D40AC43334 for ; Wed, 8 Jun 2022 20:27:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=ozeV+OiIOgpBhmL0xGI/IWue2tVtGoRCxpaHGVMIpks=; b=sjMOxk9XxET7x6 /+AKmtMelqV3ifZJ6YTIhB2XghSxLbw8xM+HtYPVbVoLcZjUwCI5DjsmUZWetNU9ivsrgAyMUUyos HlRgF62oy8NX7ks+ajgXeiihHWctzsQ47IYvk3J+P8NUIhzOzuvloSmF2dPbjA/wsew2hvYmI9mDb lIUhGXWWjtztZVelmtaokr6mPP3PqAUvqkf4LJm7tWwnpFlon05rteqcn47TV8ec/5w5aQ8p8kZtc lGZ/vp0WQOj4NQ1IzyPhsEL/A3uocJF3GI9UPaEZOF6oYWuj/rIhVdsExmY3y03hwJcWBVjlZhPIv eziWTCADM+I3z6vack1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz2Fe-00Es40-Si; Wed, 08 Jun 2022 20:26:02 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nz2Fc-00Es30-1d; Wed, 08 Jun 2022 20:26:01 +0000 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 99AB561C65; Wed, 8 Jun 2022 20:25:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9AB3C3411C; Wed, 8 Jun 2022 20:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654719959; bh=9n03tEEmAqhGngy9FDlsSxvVhf4oGNgIu1WDM3aPpt8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=MIP/DY9Y9G4P5JHPm50KarY0Kw6xmunpfKz8jD2EgTKriKOeSkhs+925w0zU63F61 b4fRGE078sIH72iILZIGxgI5eI3PePhKhISUuvbT8ufOebpCzW/bMo/EnITikUMzPJ S0Ej0tXoqbKFdKp1dSChRcr3tXHgIZ/ALUJlSthF9ilxlLLBm0f9Ga8TbdG+HYlIpR hJwtdREa0MaddcTf2IgGrxkfVgsX0XTQHUA+Vf6LKpZqBjvzWU2nkK8+awAiPNFkyo T+vebQXxfxJaWv4wDkGovmzh09abgfIQVW93lWYtBDk0BUc+V5q5DmxLZQtHHkcLEO dqDNMkr4LtVkQ== Date: Wed, 8 Jun 2022 15:25:57 -0500 From: Bjorn Helgaas To: Miaoqian Lin Cc: Nicolas Saenz Julienne , Broadcom internal kernel review list , Jim Quinlan , Florian Fainelli , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Marc Zyngier , Andrew Murray , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] PCI: brcmstb: Fix refcount leak in brcm_pcie_probe Message-ID: <20220608202557.GA419456@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220603130849.38252-1-linmq006@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220608_132600_185649_4DC2C631 X-CRM114-Status: GOOD ( 19.36 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jun 03, 2022 at 05:08:49PM +0400, Miaoqian Lin wrote: > of_parse_phandle() returns a node pointer with refcount > incremented, we should use of_node_put() on it when not need anymore. > Add missing of_node_put() to avoid refcount leak. > > Fixes: 40ca1bf580ef ("PCI: brcmstb: Add MSI support") > Signed-off-by: Miaoqian Lin Applied with Rob's reviewed-by to pci/ctrl/brcmstb for v5.20, thanks! > --- > changes in v2: > - update Fixes tag. > v1 Link: https://lore.kernel.org/r/20220602125003.10723-1-linmq006@gmail.com > --- > drivers/pci/controller/pcie-brcmstb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index 375c0c40bbf8..e3b673441a11 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -1597,8 +1597,10 @@ static int brcm_pcie_probe(struct platform_device *pdev) > ret = brcm_pcie_enable_msi(pcie); > if (ret) { > dev_err(pcie->dev, "probe of internal MSI failed"); > + of_node_put(msi_np); > goto fail; > } > + of_node_put(msi_np); > } > > bridge->ops = pcie->type == BCM7425 ? &brcm_pcie_ops32 : &brcm_pcie_ops; > -- > 2.25.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel