summaryrefslogtreecommitdiff
path: root/drivers/edac
diff options
context:
space:
mode:
authorSalah Triki <salah.triki@gmail.com>2025-07-31 04:15:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-19 16:32:03 +0200
commit6f628d7dd8ac40b036d2d188b3dcca18a7000e0f (patch)
tree1cbb2746509974e78ff36581c4012e762fd8fcfa /drivers/edac
parent2089d8a316f42208540db0ebe921273abd2e98ff (diff)
downloadlinux-6f628d7dd8ac40b036d2d188b3dcca18a7000e0f.tar.gz
linux-6f628d7dd8ac40b036d2d188b3dcca18a7000e0f.tar.bz2
linux-6f628d7dd8ac40b036d2d188b3dcca18a7000e0f.zip
EDAC/altera: Delete an inappropriate dma_free_coherent() call
commit ff2a66d21fd2364ed9396d151115eec59612b200 upstream. 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 <salah.triki@gmail.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Acked-by: Dinh Nguyen <dinguyen@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/aIrfzzqh4IzYtDVC@pc Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/edac')
-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 54ec89415093..233e58278943 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -127,7 +127,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;