Skip to content

Commit

Permalink
mm/backing-dev.c: fix percpu_counter_destroy call bug in bdi_init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis Cheng authored and Linus Torvalds committed Dec 5, 2007
1 parent 0c664f9 commit 4b01a0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/backing-dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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]);
}

Expand Down

0 comments on commit 4b01a0b

Please sign in to comment.