Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1ad2897 authored by Li Haifeng's avatar Li Haifeng Committed by Linus Torvalds
Browse files

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: default avatarHaifeng Li <omycle@gmail.com>
Acked-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 26086de3
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
	}
	}
}
}