Skip to content

Commit 83c761f

Browse files
tititiou36vinodkoul
authored andcommitted
dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc()
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') Fixes: a57e16c ("dmaengine: pxa: add pxa dmaengine driver") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/c8fc5563c9593c914fde41f0f7d1489a21b45a9a.1696676782.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 90a6c03 commit 83c761f

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/dma/pxa_dma.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,6 @@ static void pxad_free_desc(struct virt_dma_desc *vd)
722722
dma_addr_t dma;
723723
struct pxad_desc_sw *sw_desc = to_pxad_sw_desc(vd);
724724

725-
BUG_ON(sw_desc->nb_desc == 0);
726725
for (i = sw_desc->nb_desc - 1; i >= 0; i--) {
727726
if (i > 0)
728727
dma = sw_desc->hw_desc[i - 1]->ddadr;

0 commit comments

Comments
 (0)