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: <20210214132153.575350-4-zhengdejin5@gmail.com>
Date:   Sun, 14 Feb 2021 21:21:53 +0800
From:   Dejin Zheng <zhengdejin5@...il.com>
To:     gustavo.pimentel@...opsys.com, vkoul@...nel.org,
        wangzhou1@...ilicon.com, ftoth@...londelft.nl,
        andy.shevchenko@...il.com, qiuzhenfa@...ilicon.com,
        dmaengine@...r.kernel.org
Cc:     linux-kernel@...r.kernel.org, Dejin Zheng <zhengdejin5@...il.com>
Subject: [PATCH 3/3] dmaengine: hisilicon: Add missing call to 'pci_free_irq_vectors()' in probe function

Call to 'pci_free_irq_vectors()' is missing in the error handling path
of the probe function, So add it.

Fixes: e9f08b65250d73ab ("dmaengine: hisilicon: Add Kunpeng DMA engine support")
Signed-off-by: Dejin Zheng <zhengdejin5@...il.com>
---
 drivers/dma/hisi_dma.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/hisi_dma.c b/drivers/dma/hisi_dma.c
index a259ee010e9b..9e894d7f5dab 100644
--- a/drivers/dma/hisi_dma.c
+++ b/drivers/dma/hisi_dma.c
@@ -553,7 +553,7 @@ static int hisi_dma_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 	ret = devm_add_action_or_reset(dev, hisi_dma_free_irq_vectors, pdev);
 	if (ret)
-		return ret;
+		goto err_free_irq;
 
 	dma_dev = &hdma_dev->dma_dev;
 	dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
@@ -572,18 +572,24 @@ static int hisi_dma_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	ret = hisi_dma_enable_hw_channels(hdma_dev);
 	if (ret < 0) {
 		dev_err(dev, "failed to enable hw channel!\n");
-		return ret;
+		goto err_free_irq;
 	}
 
 	ret = devm_add_action_or_reset(dev, hisi_dma_disable_hw_channels,
 				       hdma_dev);
 	if (ret)
-		return ret;
+		goto err_free_irq;
 
 	ret = dmaenginem_async_device_register(dma_dev);
-	if (ret < 0)
+	if (ret < 0) {
 		dev_err(dev, "failed to register device!\n");
+		goto err_free_irq;
+	}
+
+	return ret;
 
+err_free_irq:
+	pci_free_irq_vectors(pdev);
 	return ret;
 }
 
-- 
2.25.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ