diff options
author | Omar Sandoval <osandov@fb.com> | 2018-05-26 00:47:17 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-05-26 04:12:10 +0300 |
commit | 7cbf319234adaa4518a28c8c523d3330e06638f0 (patch) | |
tree | c25ce860d1ba8ac686456d181acca73048d3a1a5 /lib/ratelimit.c | |
parent | 62d18ecfa64137349fac9c5817784fbd48b54f48 (diff) | |
download | linux-7cbf319234adaa4518a28c8c523d3330e06638f0.tar.xz |
mm: fix nr_rotate_swap leak in swapon() error case
If swapon() fails after incrementing nr_rotate_swap, we don't decrement
it and thus effectively leak it. Make sure we decrement it if we
incremented it.
Link: http://lkml.kernel.org/r/b6fe6b879f17fa68eee6cbd876f459f6e5e33495.1526491581.git.osandov@fb.com
Fixes: 81a0298bdfab ("mm, swap: don't use VMA based swap readahead if HDD is used as swap")
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Rik van Riel <riel@surriel.com>
Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/ratelimit.c')
0 files changed, 0 insertions, 0 deletions