]> git.baikalelectronics.ru Git - kernel.git/commit
dma: at_xdmac: fix a missing check on list iterator
authorXiaomeng Tong <xiam0nd.tong@gmail.com>
Sun, 27 Mar 2022 06:11:54 +0000 (14:11 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 11 Apr 2022 13:33:29 +0000 (19:03 +0530)
commitbdb86c9c1ef7b5961fef358319a1e192b085fd6c
treeac0730d794636f639dbaf3efef1f392215fd72b9
parent7a4b760d26ec37ffb959908b2a8e6e68f3f374d1
dma: at_xdmac: fix a missing check on list iterator

The bug is here:
__func__, desc, &desc->tx_dma_desc.phys, ret, cookie, residue);

The list iterator 'desc' will point to a bogus position containing
HEAD if the list is empty or no element is found. To avoid dev_dbg()
prints a invalid address, use a new variable 'iter' as the list
iterator, while use the origin variable 'desc' as a dedicated
pointer to point to the found element.

Cc: stable@vger.kernel.org
Fixes: dff86944f42f1 ("dmaengine: xdmac: fix print warning on dma_addr_t variable")
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com>
Link: https://lore.kernel.org/r/20220327061154.4867-1-xiam0nd.tong@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/at_xdmac.c