If pxad_alloc_desc() fails on the first dma_pool_alloc() call, then sw_desc->nb_desc is zero. In such a case pxad_free_desc() is called and it will BUG_ON(). Remove this erroneous BUG_ON(). It is also useless, because if "sw_desc->nb_desc == 0", then, on the first iteration of the for loop, i is -1 and the loop will not be executed. (both i and sw_desc->nb_desc are 'int') Additional info: 社区有patch已经解决 dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() commit 758f735604f82ad77b15aaa5cd6f5287c114b21c Reference:https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.10.y&id=758f735604f82ad77b15aaa5cd6f5287c114b21c git cherry-pick -s 758f735604(with stable-v5.10.201 repo added)
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2457