From: Denis Cheng Date: Wed, 5 Dec 2007 07:45:07 +0000 (-0800) Subject: mm/backing-dev.c: fix percpu_counter_destroy call bug in bdi_init X-Git-Tag: v2.6.24-rc5~101 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b01a0b1613beeb01e12c78feb69e98f0da0a69a;p=platform%2Fkernel%2Flinux-stable.git mm/backing-dev.c: fix percpu_counter_destroy call bug in bdi_init this call should use the array index j, not i. But with this approach, just one int i is enough, int j is not needed. Signed-off-by: Denis Cheng Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/backing-dev.c b/mm/backing-dev.c index b0ceb29..e8644b1 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -7,7 +7,7 @@ int bdi_init(struct backing_dev_info *bdi) { - int i, j; + int i; int err; for (i = 0; i < NR_BDI_STAT_ITEMS; i++) { @@ -21,7 +21,7 @@ int bdi_init(struct backing_dev_info *bdi) if (err) { err: - for (j = 0; j < i; j++) + while (i--) percpu_counter_destroy(&bdi->bdi_stat[i]); }