VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Chengguang Xu <cgxu519@gmx.com> 2019-02-15 20:27:11 +0800 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2019-04-02 17:49:58 +0200 commit: de36e16d1557a0b6eb328bc3516359a12ba5c25c parent: 9a41691e5e01ba38865afa7a1eaa352974bf4a6e
Commit Summary:
chardev: add additional check for minor range overlap
Diffstat:
1 file changed, 5 insertions, 0 deletions
diff --git a/fs/char_dev.c b/fs/char_dev.c
index a279c58fe360..8a63cfa29005 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -159,6 +159,12 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor,
 			ret = -EBUSY;
 			goto out;
 		}
+
+		if (new_min < old_min && new_max > old_max) {
+			ret = -EBUSY;
+			goto out;
+		}
+
 	}
 
 	cd->next = *cp;