]> git.baikalelectronics.ru Git - kernel.git/commit
mm/backing-dev.c: fix error path in wb_init()
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Fri, 12 Feb 2016 00:13:06 +0000 (16:13 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 12 Feb 2016 02:35:48 +0000 (18:35 -0800)
commitb60fc050f50bfa1048a071d849fbd337b5302847
treee4185f03f3d35cc47c79b64323701dbe5370f8cc
parent7335a171e75040881b1766fa085b9fc6d4a987d2
mm/backing-dev.c: fix error path in wb_init()

We need to use post-decrement to get percpu_counter_destroy() called on
&wb->stat[0].  Moreover, the pre-decremebt would cause infinite
out-of-bounds accesses if the setup code failed at i==0.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/backing-dev.c