mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ruan Jinjie <ruanjinjie@huawei.com>
To: <lpieralisi@kernel.org>, <robh@kernel.org>, <kw@linux.com>,
	<bhelgaas@google.com>, <Sergey.Semin@baikalelectronics.ru>,
	<mani@kernel.org>, <kishon@ti.com>, <naveennaidu479@gmail.com>,
	<pali@kernel.org>, <ffclaire1224@gmail.com>,
	<linux-pci@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PCI: dwc: add missing free_irq() in ks_pcie_remove() and error path in ks_pcie_probe()
Date: Wed, 16 Nov 2022 10:34:24 +0800	[thread overview]
Message-ID: <f15ea524-be5a-c72f-0968-63168ddb23b8@huawei.com> (raw)
In-Reply-To: <20221116022147.2636355-1-ruanjinjie@huawei.com>

The fix has a problem, I will send v2 soon.

On 2022/11/16 10:21, ruanjinjie wrote:
> free_irq() is missing in ks_pcie_remove() and some cases of error
> in ks_pcie_probe(), fix that.
> 
> Fixes: 49229238ab47 ("PCI: keystone: Cleanup PHY handling")
> 
> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
> ---
>  drivers/pci/controller/dwc/pci-keystone.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
> index 78818853af9e..fc854ccaf155 100644
> --- a/drivers/pci/controller/dwc/pci-keystone.c
> +++ b/drivers/pci/controller/dwc/pci-keystone.c
> @@ -1179,12 +1179,16 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
>  		num_lanes = 1;
>  
>  	phy = devm_kzalloc(dev, sizeof(*phy) * num_lanes, GFP_KERNEL);
> -	if (!phy)
> -		return -ENOMEM;
> +	if (!phy) {
> +		ret = -ENOMEM;
> +		goto free_irq;
> +	}
>  
>  	link = devm_kzalloc(dev, sizeof(*link) * num_lanes, GFP_KERNEL);
> -	if (!link)
> -		return -ENOMEM;
> +	if (!link) {
> +		ret = -ENOMEM;
> +		goto free_irq;
> +	}
>  
>  	for (i = 0; i < num_lanes; i++) {
>  		snprintf(name, sizeof(name), "pcie-phy%d", i);
> @@ -1300,6 +1304,8 @@ static int __init ks_pcie_probe(struct platform_device *pdev)
>  	while (--i >= 0 && link[i])
>  		device_link_del(link[i]);
>  
> +free_irq:
> +	free_irq(irq, ks_pcie);
>  	return ret;
>  }
>  
> @@ -1315,6 +1321,7 @@ static int __exit ks_pcie_remove(struct platform_device *pdev)
>  	ks_pcie_disable_phy(ks_pcie);
>  	while (num_lanes--)
>  		device_link_del(link[num_lanes]);
> +	free_irq(irq, ks_pcie);
>  
>  	return 0;
>  }

  reply	other threads:[~2022-11-16  2:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16  2:21 ruanjinjie
2022-11-16  2:34 ` Ruan Jinjie [this message]
2022-11-17 18:28 ` kernel test robot
2022-11-18  9:57 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f15ea524-be5a-c72f-0968-63168ddb23b8@huawei.com \
    --to=ruanjinjie@huawei.com \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=bhelgaas@google.com \
    --cc=ffclaire1224@gmail.com \
    --cc=kishon@ti.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=naveennaidu479@gmail.com \
    --cc=pali@kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®