[RFC PATCH 0/3] dma-mapping: clear dangling pointers consistently
- Date: Thu, 13 Sep 2018 17:17:13 +0200
- From: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
- Subject: [RFC PATCH 0/3] dma-mapping: clear dangling pointers consistently
When working with dma_set_max_seg_size(), I noticed issues with a
dangling dma_parms pointer. I saw Christoph just worked on handling
something similar for the dma_ops pointer, too. I came up with three
patches on top of Christoph's work which I send out for discussion here:
Patch 1 fixes a meanwhile stale comment.
Patch 2 makes clearing the dma_ops pointer more consistent because it
was missed on the custom ARM implementation to the best of my knowledge.
Patch 3 generalizes teardown_dma_ops to teardown_dma, so that clearing
dma_parms can be added there.
All these patches are based on the dma-mapping for-next branch. They are
build tested and runtime tested on a Renesas Salvator-XS board (R-Car
M3-N, ARM64) and Renesas Lager board (R-Car H2, ARM32).
A branch containing these (and dma_parms additions for the above boards)
can be found here:
Looking forward to opinions.
Wolfram Sang (3):
ARM: dma-mapping: update comment about handling dma_ops when detaching
dma-mapping: clear dma_ops pointer also on ARM
dma-mapping: clear dma_parms on teardown, too
arch/arm/mm/dma-mapping.c | 8 ++++----
include/linux/dma-mapping.h | 6 ++++--
2 files changed, 8 insertions(+), 6 deletions(-)