mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
dmaengine: ti: k3-udma-glue: fix NULL dereference in k3_udma_glue_release_rx_chn()
If devm_kcalloc() for rx_chn->flows fails in a channel request function,
the error path calls k3_udma_glue_release_rx_chn(), which dereferences
the NULL rx_chn->flows pointer in k3_udma_glue_release_rx_flow().
Skip the flow release loop in k3_udma_glue_release_rx_chn() when
rx_chn->flows is not allocated.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: d702419134 ("dmaengine: ti: k3-udma: Add glue layer for non DMAengine users")
Cc: stable@vger.kernel.org
Reported-by: Pavel Zhigulin <Pavel.Zhigulin@kaspersky.com>
Signed-off-by: Alexander Chesnokov <Alexander.Chesnokov@kaspersky.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260812053426.3521589-1-Alexander.Chesnokov@kaspersky.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
d1fc569fcb
commit
0294b6dd51
|
|
@ -1243,8 +1243,9 @@ void k3_udma_glue_release_rx_chn(struct k3_udma_glue_rx_channel *rx_chn)
|
|||
rx_chn->psil_paired = false;
|
||||
}
|
||||
|
||||
for (i = 0; i < rx_chn->flow_num; i++)
|
||||
k3_udma_glue_release_rx_flow(rx_chn, i);
|
||||
if (rx_chn->flows)
|
||||
for (i = 0; i < rx_chn->flow_num; i++)
|
||||
k3_udma_glue_release_rx_flow(rx_chn, i);
|
||||
|
||||
if (xudma_rflow_is_gp(rx_chn->common.udmax, rx_chn->flow_id_base))
|
||||
xudma_free_gp_rflow_range(rx_chn->common.udmax,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user