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-next>] [day] [month] [year] [list]
Message-ID: <ae19d76a10773d6ebee0e08cef49786eb20fd052.1737215423.git.christophe.jaillet@wanadoo.fr>
Date: Sat, 18 Jan 2025 16:51:01 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Basavaraj Natikar <Basavaraj.Natikar@....com>,
	Vinod Koul <vkoul@...nel.org>,
	Sanjay R Mehta <sanju.mehta@....com>
Cc: linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org,
	Christophe JAILLET <christophe.jaillet@...adoo.fr>,
	dmaengine@...r.kernel.org
Subject: [PATCH 1/3] dmaengine: ptdma: Fix an error handling parth in pt_pci_probe()

If an error occurs after a successful pt_get_irqs() call, it should be
undone by a corresponding pt_free_irqs(), as already done in the remove
function.

Fixes: fa5d823b16a9 ("dmaengine: ptdma: Initial driver for the AMD PTDMA")
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Compile tested only
---
 drivers/dma/amd/ptdma/ptdma-pci.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/amd/ptdma/ptdma-pci.c b/drivers/dma/amd/ptdma/ptdma-pci.c
index 22739ff0c3c5..7f12474bd39f 100644
--- a/drivers/dma/amd/ptdma/ptdma-pci.c
+++ b/drivers/dma/amd/ptdma/ptdma-pci.c
@@ -182,7 +182,7 @@ static int pt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		if (ret) {
 			dev_err(dev, "dma_set_mask_and_coherent failed (%d)\n",
 				ret);
-			goto e_err;
+			goto e_free_irqs;
 		}
 	}
 
@@ -192,10 +192,12 @@ static int pt_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		ret = pt_core_init(pt);
 
 	if (ret)
-		goto e_err;
+		goto e_free_irqs;
 
 	return 0;
 
+e_free_irqs:
+	pt_free_irqs(pt);
 e_err:
 	dev_err(dev, "initialization failed ret = %d\n", ret);
 
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ