From d583fb47af4da3c57e180bcf15c45515f4c00d1e Mon Sep 17 00:00:00 2001 From: Jassi Brar Date: Wed, 20 Oct 2010 11:56:26 +0900 Subject: ARM: S3C_PL330: Debug potential null pointer reference Using 'safe' version of iteration, since we delete the list entry. Signed-off-by: Jassi Brar Change-Id: I4dd463c3e0627703c405a4ce5b385cdd3f03ce42 Signed-off-by: Choi jonghwan --- arch/arm/plat-samsung/s3c-pl330.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/plat-samsung/s3c-pl330.c b/arch/arm/plat-samsung/s3c-pl330.c index 60f703c..3b88d8f 100644 --- a/arch/arm/plat-samsung/s3c-pl330.c +++ b/arch/arm/plat-samsung/s3c-pl330.c @@ -1172,7 +1172,7 @@ probe_err1: static int pl330_remove(struct platform_device *pdev) { struct s3c_pl330_dmac *dmac, *d; - struct s3c_pl330_chan *ch; + struct s3c_pl330_chan *ch, *cht; unsigned long flags; int del, found; @@ -1196,7 +1196,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, cht, &chan_list, node) { /* Only channels that are handled by this DMAC */ if (iface_of_dmac(dmac, ch->id)) -- cgit v1.1