Skip to content

Commit 4188658

Browse files
salah-trikigregkh
authored andcommitted
EDAC/altera: Delete an inappropriate dma_free_coherent() call
commit ff2a66d 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: 71bcada ("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>
1 parent 0b8f642 commit 4188658

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
@@ -127,7 +127,6 @@ static ssize_t altr_sdr_mc_err_inject_write(struct file *file,
127127

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

0 commit comments

Comments
 (0)