Bug 7620 - dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc()
Summary: dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc()
Status: NEW
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-24 10:11 UTC by zhujun
Modified: 2023-11-24 10:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhujun cmss_group 2023-11-24 10:11:31 UTC
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)
Comment 1 小龙 admin 2023-11-24 10:14:44 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/2457