dmaengine: stm32-mdma: Use struct_size() in kzalloc()
PATCH 1/1 dmaengine: stm32-mdma: Use struct_size() in kzalloc()
Make use of the new struct_size() helper instead of the offsetof() idiom.
Signed-off-by Gustavo A. R. Silva <[email protected]>
--- drivers/dma/stm32-mdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/stm32-mdma.c +1 -1
@@ -339,7 +339,7 @@ static struct stm32_mdma_desc *stm32_mdma_alloc_desc(struct stm32_mdma_desc *desc;int i; - desc = kzalloc(offsetof(typeof(*desc), node[count]), GFP_NOWAIT); + desc =kzalloc (struct_size (desc, node, count),GFP_NOWAIT );if (!desc)return NULL ;
Signature · 1 line
2.27.0
Quoted 1 line · Gustavo A. R. Silva
Make use of the new
struct_size()helper instead of theoffsetof()idiom.
Applied, thanks
Signature · 6 lines
~Vinod _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel