dmaengine: ti: k3-udma: Fix NULL pointer dereference error
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>
Please register or sign in to comment