aboutsummaryrefslogtreecommitdiffstats
path: root/mm/frontswap.c
diff options
context:
space:
mode:
authorLi Haifeng <omycle@gmail.com>2014-12-10 18:44:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 20:41:08 -0500
commita1ad28973d3d9fe23fa73fbb66fba077a987dd81 (patch)
tree53bae97999593fcd65ff02132646477d0ad41dde /mm/frontswap.c
parent26086de3fcc9694b9f9c1517e4fd5d1d33d6eb8c (diff)
mm/frontswap.c: fix the condition in BUG_ON
The largest index of swap device is MAX_SWAPFILES-1. So the type should be less than MAX_SWAPFILES. Signed-off-by: Haifeng Li <omycle@gmail.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/frontswap.c')
-rw-r--r--mm/frontswap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/frontswap.c b/mm/frontswap.c
index f2a3571c6e22..8d82809eb085 100644
--- a/mm/frontswap.c
+++ b/mm/frontswap.c
@@ -182,7 +182,7 @@ void __frontswap_init(unsigned type, unsigned long *map)
182 if (frontswap_ops) 182 if (frontswap_ops)
183 frontswap_ops->init(type); 183 frontswap_ops->init(type);
184 else { 184 else {
185 BUG_ON(type > MAX_SWAPFILES); 185 BUG_ON(type >= MAX_SWAPFILES);
186 set_bit(type, need_init); 186 set_bit(type, need_init);
187 } 187 }
188} 188}