[PATCH] EDAC: altera: Delete dma_free_coherent()

Salah Triki posted 1 patch 2 months, 2 weeks ago
drivers/edac/altera_edac.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] EDAC: altera: Delete dma_free_coherent()
Posted by Salah Triki 2 months, 2 weeks ago
dma_free_coherent() need to be called only when dma_alloc_coherent()
succeed.

Signed-off-by: Salah Triki <salah.triki@gmail.com>
---
 drivers/edac/altera_edac.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index cae52c654a15..7685a8550d4b 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -128,7 +128,6 @@ static ssize_t altr_sdr_mc_err_inject_write(struct file *file,
 
 	ptemp = dma_alloc_coherent(mci->pdev, 16, &dma_handle, GFP_KERNEL);
 	if (!ptemp) {
-		dma_free_coherent(mci->pdev, 16, ptemp, dma_handle);
 		edac_printk(KERN_ERR, EDAC_MC,
 			    "Inject: Buffer Allocation error\n");
 		return -ENOMEM;
-- 
2.43.0
Re: [PATCH] EDAC: altera: Delete dma_free_coherent()
Posted by Markus Elfring 2 months, 1 week ago
> dma_free_coherent() need to be called only when dma_alloc_coherent()
> succeed.

  succeeded?

How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16-rc7#n145

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.16-rc7#n94


Would the summary phrase “Delete an inappropriate dma_free_coherent() call
in altr_sdr_mc_err_inject_write()” be more appropriate?

Regards,
Markus