Skip to content
Commit 0ab75e00 authored by Kishon Vijay Abraham I's avatar Kishon Vijay Abraham I Committed by Xulin Sun
Browse files

dmaengine: ti: k3-udma: Fix NULL pointer dereference error

commit da3c66f551423e960049fd66ae907c5909352d8f from
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git

bcdma_get_*() and udma_get_*() checks if bchan/rchan/tchan/rflow is
already allocated by checking if it has a NON NULL value. For the
error cases, bchan/rchan/tchan/rflow will have error value
and bcdma_get_*() 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
bchan/rchan/tchan/rflow.

Reset the value of bchan/rchan/tchan/rflow to NULL if the allocation
actually fails.

Fixes: 01779473 ("dmaengine: ti: k3-udma: Initial support for K3 BCDMA")
Fixes: 25dcb5dd

 ("dmaengine: ti: New driver for K3 UDMA")
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: default avatarXulin Sun <xulin.sun@windriver.com>
parent 05c02145
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment