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)
commiteb91224e47ec33a0a32c9be0ec0fcb3433e555fd
tree4205f3761a61cc35fc9202465a59f60bd9b7aa48
parent5c6c6d60e4b489308ae4da8424c869f7cc53cd12
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