aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSalah Triki <[email protected]>2025-07-31 03:15:27 +0000
committerBorislav Petkov (AMD) <[email protected]>2025-08-25 11:56:16 +0000
commitff2a66d21fd2364ed9396d151115eec59612b200 (patch)
treedfe6d2b20edd370b6f34a937651ec054d1229a5d
parentLinux 6.17-rc3 (diff)
downloadkernel-ff2a66d21fd2364ed9396d151115eec59612b200.tar.gz
kernel-ff2a66d21fd2364ed9396d151115eec59612b200.zip
EDAC/altera: Delete an inappropriate dma_free_coherent() call
dma_free_coherent() must only be called if the corresponding dma_alloc_coherent() call has succeeded. Calling it when the allocation fails leads to undefined behavior. Delete the wrong call. [ bp: Massage commit message. ] Fixes: 71bcada88b0f3 ("edac: altera: Add Altera SDRAM EDAC support") Signed-off-by: Salah Triki <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Acked-by: Dinh Nguyen <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/aIrfzzqh4IzYtDVC@pc
-rw-r--r--drivers/edac/altera_edac.c1
1 files changed, 0 insertions, 1 deletions
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;