mirror of
https://github.com/torvalds/linux
synced 2024-09-16 00:58:07 +00:00
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)
|
if (frontswap_ops)
|
||||||
frontswap_ops->init(type);
|
frontswap_ops->init(type);
|
||||||
else {
|
else {
|
||||||
BUG_ON(type > MAX_SWAPFILES);
|
BUG_ON(type >= MAX_SWAPFILES);
|
||||||
set_bit(type, need_init);
|
set_bit(type, need_init);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue