Commit abd9a0c3 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

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: default avatarGerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 519fe2ec
...@@ -71,8 +71,8 @@ static inline void dma_free_coherent(struct device *dev, size_t size, ...@@ -71,8 +71,8 @@ static inline void dma_free_coherent(struct device *dev, size_t size,
{ {
struct dma_map_ops *dma_ops = get_dma_ops(dev); struct dma_map_ops *dma_ops = get_dma_ops(dev);
dma_ops->free(dev, size, cpu_addr, dma_handle, NULL);
debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); debug_dma_free_coherent(dev, size, cpu_addr, dma_handle);
dma_ops->free(dev, size, cpu_addr, dma_handle, NULL);
} }
#endif /* _ASM_S390_DMA_MAPPING_H */ #endif /* _ASM_S390_DMA_MAPPING_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment