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

Commit 215122e1 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

[PATCH] register_chrdev_region() don't hand out the LOCAL/EXPERIMENTAL majors

As pointed out in http://bugzilla.kernel.org/show_bug.cgi?id=7922

, dynamic
chardev major allocation can hand out majors which LANANA has defined as being
for local/experimental use.

Cc: Torben Mathiasen <device@lanana.org>
Cc: Greg KH <greg@kroah.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Tomas Klas <tomas.klas@mepatek.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6ab8eb1c
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -108,6 +108,13 @@ __register_chrdev_region(unsigned int major, unsigned int baseminor,
	/* temporary */
	/* temporary */
	if (major == 0) {
	if (major == 0) {
		for (i = ARRAY_SIZE(chrdevs)-1; i > 0; i--) {
		for (i = ARRAY_SIZE(chrdevs)-1; i > 0; i--) {
			/*
			 * Disallow the LANANA-assigned LOCAL/EXPERIMENTAL
			 * majors
			 */
			if ((60 <= i && i <= 63) || (120 <= i && i <= 127) ||
					(240 <= i && i <= 254))
				continue;
			if (chrdevs[i] == NULL)
			if (chrdevs[i] == NULL)
				break;
				break;
		}
		}