forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
26086de3fc
commit
a1ad28973d
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user