linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Pimentel <Gustavo.Pimentel@synopsys.com>
To: Dejin Zheng <zhengdejin5@gmail.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"wangzhou1@hisilicon.com" <wangzhou1@hisilicon.com>,
	"ftoth@exalondelft.nl" <ftoth@exalondelft.nl>,
	"andy.shevchenko@gmail.com" <andy.shevchenko@gmail.com>,
	"qiuzhenfa@hisilicon.com" <qiuzhenfa@hisilicon.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function
Date: Mon, 15 Feb 2021 09:45:07 +0000	[thread overview]
Message-ID: <DM5PR12MB18357590D1A8C22A1E7287BCDA889@DM5PR12MB1835.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20210214132153.575350-3-zhengdejin5@gmail.com>

On Sun, Feb 14, 2021 at 13:21:52, Dejin Zheng <zhengdejin5@gmail.com> 
wrote:

> Call to 'pci_free_irq_vectors()' is missing in the error handling path
> of the probe function, So add it.
> 
> Fixes: 41aaff2a2ac01c5 ("dmaengine: Add Synopsys eDMA IP PCIe glue-logic")
> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
> ---
>  drivers/dma/dw-edma/dw-edma-pcie.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> index 1eafc602e17e..c1e796bd3ee9 100644
> --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> +++ b/drivers/dma/dw-edma/dw-edma-pcie.c
> @@ -185,24 +185,31 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
>  	/* Validating if PCI interrupts were enabled */
>  	if (!pci_dev_msi_enabled(pdev)) {
>  		pci_err(pdev, "enable interrupt failed\n");
> -		return -EPERM;
> +		err = -EPERM;
> +		goto err_free_irq;
>  	}
>  
>  	dw->irq = devm_kcalloc(dev, nr_irqs, sizeof(*dw->irq), GFP_KERNEL);
> -	if (!dw->irq)
> -		return -ENOMEM;
> +	if (!dw->irq) {
> +		err = -ENOMEM;
> +		goto err_free_irq;
> +	}
>  
>  	/* Starting eDMA driver */
>  	err = dw_edma_probe(chip);
>  	if (err) {
>  		pci_err(pdev, "eDMA probe failed\n");
> -		return err;
> +		goto err_free_irq;
>  	}
>  
>  	/* Saving data structure reference */
>  	pci_set_drvdata(pdev, chip);
>  
>  	return 0;
> +
> +err_free_irq:
> +	pci_free_irq_vectors(pdev);
> +	return err;
>  }
>  
>  static void dw_edma_pcie_remove(struct pci_dev *pdev)
> -- 
> 2.25.0

Acked-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>



  reply	other threads:[~2021-02-15  9:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-14 13:21 [PATCH 0/3] Add missing call to 'pci_free_irq_vectors()' Dejin Zheng
2021-02-14 13:21 ` [PATCH 1/3] dmaengine: hsu: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions Dejin Zheng
2021-02-15 13:25   ` Andy Shevchenko
2021-02-14 13:21 ` [PATCH 2/3] dmaengine: dw-edma: Add missing call to 'pci_free_irq_vectors()' in probe function Dejin Zheng
2021-02-15  9:45   ` Gustavo Pimentel [this message]
2021-02-15 12:46     ` Dejin Zheng
2021-02-14 13:21 ` [PATCH 3/3] dmaengine: hisilicon: " Dejin Zheng

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=DM5PR12MB18357590D1A8C22A1E7287BCDA889@DM5PR12MB1835.namprd12.prod.outlook.com \
    --to=gustavo.pimentel@synopsys.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=ftoth@exalondelft.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qiuzhenfa@hisilicon.com \
    --cc=vkoul@kernel.org \
    --cc=wangzhou1@hisilicon.com \
    --cc=zhengdejin5@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).