Commit 4b01a0b1 authored by Denis Cheng's avatar Denis Cheng Committed by Linus Torvalds

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: default avatarDenis Cheng <crquan@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0c664f97
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
int bdi_init(struct backing_dev_info *bdi) int bdi_init(struct backing_dev_info *bdi)
{ {
int i, j; int i;
int err; int err;
for (i = 0; i < NR_BDI_STAT_ITEMS; i++) { for (i = 0; i < NR_BDI_STAT_ITEMS; i++) {
...@@ -21,7 +21,7 @@ int bdi_init(struct backing_dev_info *bdi) ...@@ -21,7 +21,7 @@ int bdi_init(struct backing_dev_info *bdi)
if (err) { if (err) {
err: err:
for (j = 0; j < i; j++) while (i--)
percpu_counter_destroy(&bdi->bdi_stat[i]); percpu_counter_destroy(&bdi->bdi_stat[i]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment