summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Kissel <Zachary.Kissel@Sun.COM>2009-08-03 16:11:09 -0400
committerZach Kissel <Zachary.Kissel@Sun.COM>2009-08-03 16:11:09 -0400
commit6074f19f4f7fc46d66216416827712a7511abffb (patch)
tree30cef6aa58a3765a67f245d5ac5782ce3d6598d7
parent20bc265b0a583202225a5621ab565fc73a34404d (diff)
downloadillumos-gate-6074f19f4f7fc46d66216416827712a7511abffb.tar.gz
6757244 okm_info assumes dip is valid
-rw-r--r--usr/src/uts/sun4u/opl/io/oplkmdrv.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/src/uts/sun4u/opl/io/oplkmdrv.c b/usr/src/uts/sun4u/opl/io/oplkmdrv.c
index dc4ace7432..0d23106e9e 100644
--- a/usr/src/uts/sun4u/opl/io/oplkmdrv.c
+++ b/usr/src/uts/sun4u/opl/io/oplkmdrv.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -293,15 +293,20 @@ okm_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
int
okm_info(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result)
{
- okms_t *okmsp;
+ okms_t *okmsp = &okms_global;
minor_t minor;
int ret = DDI_FAILURE;
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
+ /*
+ * We have the case here where the minor number
+ * is the same as the instance number. So, just
+ * make sure we have the right minor node in our
+ * global state. If we don't, set the result to NULL.
+ */
minor = getminor((dev_t)arg);
- okmsp = ddi_get_driver_private(dip);
- if (okmsp == NULL) {
+ if (okmsp->km_inst != minor) {
*result = NULL;
} else {
*result = okmsp->km_dip;