Skip to content

Commit ff2a66d

Browse files
salah-trikibp3tk0v
authored andcommitted
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: 71bcada ("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
1 parent 1b237f1 commit ff2a66d

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/edac/altera_edac.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ static ssize_t altr_sdr_mc_err_inject_write(struct file *file,
128128

129129
ptemp = dma_alloc_coherent(mci->pdev, 16, &dma_handle, GFP_KERNEL);
130130
if (!ptemp) {
131-
dma_free_coherent(mci->pdev, 16, ptemp, dma_handle);
132131
edac_printk(KERN_ERR, EDAC_MC,
133132
"Inject: Buffer Allocation error\n");
134133
return -ENOMEM;

0 commit comments

Comments
 (0)