Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/dma: do not call debug_dma after free

In dma_free_coherent call debug_dma_free_coherent before deallocating
the memory to avoid a possible use after free.

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
abd9a0c3 519fe2ec

+1 -1
+1 -1
arch/s390/include/asm/dma-mapping.h
··· 71 71 { 72 72 struct dma_map_ops *dma_ops = get_dma_ops(dev); 73 73 74 - dma_ops->free(dev, size, cpu_addr, dma_handle, NULL); 75 74 debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); 75 + dma_ops->free(dev, size, cpu_addr, dma_handle, NULL); 76 76 } 77 77 78 78 #endif /* _ASM_S390_DMA_MAPPING_H */