EDAC: altera: Delete an inappropriate dma_free_coherent() call in altr_sdr_mc_err_inject_write()
Subsystems (2)
PATCH v2 1/1 EDAC: altera: Delete an inappropriate dma_free_coherent() call in altr_sdr_mc_err_inject_write()
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, so remove it.
Signed-off-by Salah Triki <[email protected]>
Fixes 71bcada88b0f3 ("edac: altera: Add Altera SDRAM EDAC support")
Cc Markus Elfring <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Tony Luck <[email protected]>
Cc James Morse <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Robert Richter <[email protected]>
Acked-by Dinh Nguyen <[email protected]>
---
Changes in v2:
- Improve commit message, as suggested by Markus Elfring.
- Add Acked-by: Dinh Nguyen <[email protected]>
drivers/edac/altera_edac.c | 1 - 1 file changed, 1 deletion(-)
drivers/edac/altera_edac.c +0 -1
@@ -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