dmaengine: mmp_pdma: fix reference count leaks in mmp_pdma_probe
The issue happens in an error handling path. If of_dma_controller_register() fails, the function simply prints error messages and returns error code, without decrementing the reference count of pdev->device incremented earlier by dma_async_device_register(), which may result in refcount leaks. Fix it by invoking dma_async_device_unregister() before returning the error code. Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Link: https://lore.kernel.org/r/20210911070533.3114-1-xiongx18@fudan.edu.cnSigned-off-by: Vinod Koul <vkoul@kernel.org>
Showing
Please register or sign in to comment