Re: [PATCH v3] dmaengine: loongson1-apb-dma: avoid using iterator variable after list_for_each_entry()
From: Vinod Koul
Date: Fri Nov 20 2026 - 05:01:10 EST
On Thu, 17 Sep 2026 16:30:25 +0000, Mahad Ibrahim wrote:
> ls1x_dma_tx_status() locates the descriptor actively being processed by
> walking the LLI list and comparing the hardware reported next descriptor
> pointer against each element's next-descriptor pointer.
>
> A list_for_each_entry macro is used in the comparison phase, which at
> the end of the loop leaves the lli pointer at the currently executing LLI.
> However this also subsequently runs for a non-match lli, in which it
> points at the head. This causes a type confusion bug which treats the
> head, which is a ls1x_dma_desc, as a ls1x_dma_lli object. Additionally it
> goes forwards and prints garbage via the dev_dbg.
>
> [...]
Applied, thanks!
[1/1] dmaengine: loongson1-apb-dma: avoid using iterator variable after list_for_each_entry()
commit: 5d4f5cdad22b181559c0bc8088f3ae9572ae4362
Best regards,
--
~Vinod