提交 a1ad2897 编写于 作者: L Li Haifeng 提交者: Linus Torvalds

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: NHaifeng Li <omycle@gmail.com>
Acked-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 26086de3
......@@ -182,7 +182,7 @@ void __frontswap_init(unsigned type, unsigned long *map)
if (frontswap_ops)
frontswap_ops->init(type);
else {
BUG_ON(type > MAX_SWAPFILES);
BUG_ON(type >= MAX_SWAPFILES);
set_bit(type, need_init);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册