summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/modload/drvsubr.c11
-rw-r--r--usr/src/uts/common/ktli/t_kopen.c4
2 files changed, 10 insertions, 5 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;
diff --git a/usr/src/uts/common/ktli/t_kopen.c b/usr/src/uts/common/ktli/t_kopen.c
index c373d4a7f9..aec085ba06 100644
--- a/usr/src/uts/common/ktli/t_kopen.c
+++ b/usr/src/uts/common/ktli/t_kopen.c
@@ -36,8 +36,6 @@
* contributors.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Kernel TLI-like function to initialize a transport
* endpoint using the protocol specified.
@@ -94,7 +92,7 @@ t_kopen(file_t *fp, dev_t rdev, int flags, TIUSER **tiptr, cred_t *cr)
error = 0;
retval = 0;
if (fp == NULL) {
- if (rdev == 0 || rdev == NODEV) {
+ if (rdev == NODEV) {
KTLILOG(1, "t_kopen: null device\n", 0);
return (EINVAL);
}