]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: ti: k3-udma: Set r/tchan or rflow to NULL if request fail
authorKishon Vijay Abraham I <kishon@ti.com>
Sun, 31 Oct 2021 03:24:11 +0000 (08:54 +0530)
committerVinod Koul <vkoul@kernel.org>
Tue, 9 Nov 2021 05:54:06 +0000 (11:24 +0530)
commitdd4f563669dea702c06cc57d1079ea342fbe9d1e
tree4205f3761a61cc35fc9202465a59f60bd9b7aa48
parenteea8e681674f3861fdd70f9b247efe9d53906adf
dmaengine: ti: k3-udma: Set r/tchan or rflow to NULL if request fail

udma_get_*() checks if rchan/tchan/rflow is already allocated by checking
if it has a NON NULL value. For the error cases, rchan/tchan/rflow will
have error value and udma_get_*() considers this as already allocated
(PASS) since the error values are NON NULL. This results in NULL pointer
dereference error while de-referencing rchan/tchan/rflow.

Reset the value of rchan/tchan/rflow to NULL if a channel request fails.

CC: stable@vger.kernel.org
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Link: https://lore.kernel.org/r/20211031032411.27235-3-kishon@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ti/k3-udma.c