summaryrefslogtreecommitdiff
path: root/usr/src/cmd/modload/drvsubr.c
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2010-10-11 18:41:37 -0400
committerRichard Lowe <richlowe@richlowe.net>2010-10-11 18:41:37 -0400
commit746b01876e5bb0aa289cb6ff1991bc355e4385b6 (patch)
treecf5259d7b1db8a12b8b63fa863dfb31ee9ea7b69 /usr/src/cmd/modload/drvsubr.c
parent88181e00c06e1cd9871de83b79e83b00100d29cd (diff)
downloadillumos-gate-746b01876e5bb0aa289cb6ff1991bc355e4385b6.tar.gz
260 some drivers erroneously discount a major of 0
Reviewed by: garrett@nexenta.com, gwr@nexenta.com Approved by: garrett@nexenta.com --HG-- extra : rebase_source : c6cee93f834c8cf7b1e18611bf25a08cdc849953
Diffstat (limited to 'usr/src/cmd/modload/drvsubr.c')
-rw-r--r--usr/src/cmd/modload/drvsubr.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/cmd/modload/drvsubr.c b/usr/src/cmd/modload/drvsubr.c
index 0af9f4a27f..83282f471f 100644
--- a/usr/src/cmd/modload/drvsubr.c
+++ b/usr/src/cmd/modload/drvsubr.c
@@ -2316,8 +2316,15 @@ update_name_to_major(char *driver_name, major_t *major_num, int server)
return (ERROR);
}
- /* find first free major number */
- for (i = 0; i < max_dev; i++) {
+ /*
+ * Find the first free major number.
+ *
+ * Note that we begin searching from 1, as drivers have developer the
+ * erroneous assumption that a dev_t of 0 is invalid, and since we no
+ * longer include system devices in the base files, a major number of
+ * 0 may now be given to arbitrary devices.
+ */
+ for (i = 1; i < max_dev; i++) {
if (num_list[i] != 1) {
new_maj = i;
break;