summaryrefslogtreecommitdiff
path: root/drivers/dma/mmp_tdma.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-10-07 13:13:10 +0200
committerVinod Koul <vkoul@kernel.org>2023-10-09 10:47:26 +0530
commit0481291f0ccbc5147635cf0eb108f9fe5a05ee7d (patch)
treedeb32bfff86c301681ee9914137842e057822e83 /drivers/dma/mmp_tdma.c
parent83c761f568733277ce1f7eb9dc9e890649c29a8c (diff)
dmaengine: pxa_dma: Annotate struct pxad_desc_sw with __counted_by
Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). To do so, the code needs a little shuffling related to how hw_desc is used and nb_desc incremented. The one by one increment is needed for the error handling path, calling pxad_free_desc(), to work correctly. So, add a new intermediate variable, desc, to store the result of the dma_pool_alloc() call. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/1c9ef22826f449a3756bb13a83494e9fe3e0be8b.1696676782.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/mmp_tdma.c')
0 files changed, 0 insertions, 0 deletions