Skip to contentSkip to conversation

EDAC: altera: Delete dma_free_coherent()

PATCH In review Salah Triki 2 participants 2 messages Jul 23, 2025 – Jul 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 EDAC: altera: Delete dma_free_coherent()

dma_free_coherent() need to be called only when dma_alloc_coherent() succeed.

---
 drivers/edac/altera_edac.c | 1 -
 1 file changed, 1 deletion(-)
drivers/edac/altera_edac.c +0 -1
index cae52c654a15..7685a8550d4b 100644
@@ -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;
Signature · 1 line
2.43.0
#1 lore raw
Quoted 2 lines

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