From: hhb <421806649@qq.com> Date: Thu, 26 Sep 2013 07:29:00 +0000 (+0800) Subject: dma pl330: fix bug of dma chan list operation X-Git-Tag: firefly_0821_release~6597 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2b0734a89d00b5cc6e0442d3221584cf65797c31;p=firefly-linux-kernel-4.4.55.git dma pl330: fix bug of dma chan list operation --- diff --git a/arch/arm/plat-rk/dma-pl330.c b/arch/arm/plat-rk/dma-pl330.c index 302110878a73..1303a0e7d73d 100644 --- a/arch/arm/plat-rk/dma-pl330.c +++ b/arch/arm/plat-rk/dma-pl330.c @@ -1239,6 +1239,7 @@ static int pl330_remove(struct platform_device *pdev) { struct rk29_pl330_dmac *dmac, *d; struct rk29_pl330_chan *ch; + struct rk29_pl330_chan *ch_temp; unsigned long flags; int del, found; @@ -1262,7 +1263,7 @@ static int pl330_remove(struct platform_device *pdev) dmac = d; /* Remove all Channels that are managed only by this DMAC */ - list_for_each_entry(ch, &chan_list, node) { + list_for_each_entry_safe(ch, ch_temp, &chan_list, node) { /* Only channels that are handled by this DMAC */ if (iface_of_dmac(dmac, ch->id))