4970862 update_drv of uninstalled driver leaves false entry in /etc/driver_aliases
authorcth
Tue, 20 Sep 2005 14:52:33 -0700
changeset 579 6139238196bb
parent 578 aa1ffd6f3e7b
child 580 70dfd36fd02c
4970862 update_drv of uninstalled driver leaves false entry in /etc/driver_aliases
usr/src/cmd/modload/update_drv.c
--- a/usr/src/cmd/modload/update_drv.c	Tue Sep 20 14:47:43 2005 -0700
+++ b/usr/src/cmd/modload/update_drv.c	Tue Sep 20 14:52:33 2005 -0700
@@ -20,7 +20,7 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -284,6 +284,21 @@
 		}
 
 		if (i_flag) {
+			found = get_major_no(driver_name, name_to_major);
+			if (found == ERROR) {
+				(void) fprintf(stderr, gettext(ERR_MAX_MAJOR),
+				    name_to_major);
+				err_exit();
+			}
+
+			if (found == UNIQUE) {
+				(void) fprintf(stderr,
+				    gettext(ERR_NOT_INSTALLED), driver_name);
+				err_exit();
+			}
+
+			major_num = (major_t)found;
+
 			/* check if the alias is unique */
 			if ((error = aliases_unique(aliases)) == ERROR) {
 				exit_unlock();
@@ -299,21 +314,6 @@
 				return (error);
 			}
 
-			found = get_major_no(driver_name, name_to_major);
-			if (found == ERROR) {
-				(void) fprintf(stderr, gettext(ERR_MAX_MAJOR),
-				    name_to_major);
-				err_exit();
-			}
-
-			if (found == UNIQUE) {
-				(void) fprintf(stderr,
-				    gettext(ERR_NOT_INSTALLED), driver_name);
-				err_exit();
-			}
-
-			major_num = (major_t)found;
-
 			/* paranoia - if we crash whilst configuring */
 			sync();