]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dmaengine: ti: omap-dma: Initialize sglen after allocation
authorKees Cook <kees@kernel.org>
Tue, 16 Jul 2024 21:57:06 +0000 (14:57 -0700)
committerVinod Koul <vkoul@kernel.org>
Mon, 5 Aug 2024 16:58:13 +0000 (22:28 +0530)
commit5e5c793c7fc47219998465361d94510fdf55d83f
treef8086f6fc23e7a6ed137329c7b088f1822f42aab
parent2ebc36b9581df31eed271e5de61fc8a8b66dbc56
dmaengine: ti: omap-dma: Initialize sglen after allocation

With the new __counted_by annocation, the "sglen" struct member must
be set before accessing the "sg" array. This initialization was done in
other places where a new struct omap_desc is allocated, but these cases
were missed. Set "sglen" after allocation.

Fixes: b85178611c11 ("dmaengine: ti: omap-dma: Annotate struct omap_desc with __counted_by")
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20240716215702.work.802-kees@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/omap-dma.c