diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2019-04-29 14:37:13 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-05-02 04:01:53 +0200 |
commit | 81a812c98b6eda7e3101305d57354433e3edc541 (patch) | |
tree | 1c91b5def39290994505c774227bf1583ca0089f /sound/soc/sprd | |
parent | ASoC: sprd: Fix return value check in sprd_mcdt_probe() (diff) | |
download | linux-81a812c98b6eda7e3101305d57354433e3edc541.tar.xz linux-81a812c98b6eda7e3101305d57354433e3edc541.zip |
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: d7bff893e04f ("ASoC: sprd: Add Spreadtrum multi-channel data transfer support")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sprd')
-rw-r--r-- | sound/soc/sprd/sprd-mcdt.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/sprd/sprd-mcdt.c b/sound/soc/sprd/sprd-mcdt.c index e9318d7a4810..7448015a4935 100644 --- a/sound/soc/sprd/sprd-mcdt.c +++ b/sound/soc/sprd/sprd-mcdt.c @@ -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); |