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:Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by:
Xulin Sun <xulin.sun@windriver.com>
Loading
Please register or sign in to comment