未验证 提交 81a812c9 编写于 作者: W Wei Yongjun 提交者: Mark Brown

ASoC: sprd: Fix to use list_for_each_entry_safe() when delete items

Since we will remove items off the list using list_del() we need
to use a safe version of the list_for_each_entry() macro aptly named
list_for_each_entry_safe().

Fixes: d7bff893 ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support")
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: NBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 7c88b928
......@@ -978,12 +978,12 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
static int sprd_mcdt_remove(struct platform_device *pdev)
{
struct sprd_mcdt_chan *temp;
struct sprd_mcdt_chan *chan, *temp;
mutex_lock(&sprd_mcdt_list_mutex);
list_for_each_entry(temp, &sprd_mcdt_chan_list, list)
list_del(&temp->list);
list_for_each_entry_safe(chan, temp, &sprd_mcdt_chan_list, list)
list_del(&chan->list);
mutex_unlock(&sprd_mcdt_list_mutex);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册