mm/backing-dev.c: fix percpu_counter_destroy call bug in bdi_init
authorDenis Cheng <crquan@gmail.com>
Wed, 5 Dec 2007 07:45:07 +0000 (23:45 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 5 Dec 2007 17:21:18 +0000 (09:21 -0800)
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 <crquan@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/backing-dev.c

index b0ceb29..e8644b1 100644 (file)
@@ -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]);
        }