dma pl330: fix bug of dma chan list operation
authorhhb <421806649@qq.com>
Thu, 26 Sep 2013 07:29:00 +0000 (15:29 +0800)
committerhhb <421806649@qq.com>
Thu, 26 Sep 2013 07:29:00 +0000 (15:29 +0800)
arch/arm/plat-rk/dma-pl330.c

index 302110878a7395ad4802980d46c2cbe75daa0583..1303a0e7d73d3bf0a6dffd421a31901223d46972 100644 (file)
@@ -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))