chardev: add additional check for minor range overlap
authorChengguang Xu <cgxu519@gmx.com>
Fri, 15 Feb 2019 12:27:11 +0000 (20:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:48:29 +0000 (06:48 -0700)
commitbb22efcb872b8108131a38399ae910dcb0304770
treefa0cb94ef17f7e234afd1d890e8761f4090cdb43
parentde90525fbe776d0faa3073aec11e6718eced518e
chardev: add additional check for minor range overlap

[ Upstream commit de36e16d1557a0b6eb328bc3516359a12ba5c25c ]

Current overlap checking cannot correctly handle
a case which is baseminor < existing baseminor &&
baseminor + minorct > existing baseminor + minorct.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/char_dev.c