lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM5PR12MB18357590D1A8C22A1E7287BCDA889@DM5PR12MB1835.namprd12.prod.outlook.com>
Date:   Mon, 15 Feb 2021 09:45:07 +0000
From:   Gustavo Pimentel <Gustavo.Pimentel@...opsys.com>
To:     Dejin Zheng <zhengdejin5@...il.com>,
        "vkoul@...nel.org" <vkoul@...nel.org>,
        "wangzhou1@...ilicon.com" <wangzhou1@...ilicon.com>,
        "ftoth@...londelft.nl" <ftoth@...londelft.nl>,
        "andy.shevchenko@...il.com" <andy.shevchenko@...il.com>,
        "qiuzhenfa@...ilicon.com" <qiuzhenfa@...ilicon.com>,
        "dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 2/3] dmaengine: dw-edma: Add missing call to
 'pci_free_irq_vectors()' in probe function

On Sun, Feb 14, 2021 at 13:21:52, Dejin Zheng <zhengdejin5@...il.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@...il.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@...opsys.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ