summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/io/blkdev/blkdev.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/src/uts/common/io/blkdev/blkdev.c b/usr/src/uts/common/io/blkdev/blkdev.c
index 847c7c58fc..7e5e5716e2 100644
--- a/usr/src/uts/common/io/blkdev/blkdev.c
+++ b/usr/src/uts/common/io/blkdev/blkdev.c
@@ -22,11 +22,10 @@
* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved.
* Copyright 2012 Alexey Zaytsev <alexey.zaytsev@gmail.com> All rights reserved.
- * Copyright 2016 Nexenta Systems, Inc. All rights reserved.
* Copyright 2017 The MathWorks, Inc. All rights reserved.
- * Copyright 2019 Western Digital Corporation.
* Copyright 2020 Joyent, Inc.
* Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
+ * Copyright 2022 Tintri by DDN, Inc. All rights reserved.
*/
#include <sys/types.h>
@@ -719,7 +718,6 @@ bd_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
bd->d_dip = dip;
bd->d_handle = hdl;
- hdl->h_bd = bd;
ddi_set_driver_private(dip, bd);
mutex_init(&bd->d_ksmutex, NULL, MUTEX_DRIVER, NULL);
@@ -862,6 +860,7 @@ bd_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
"hotpluggable", NULL, 0);
}
+ hdl->h_bd = bd;
ddi_report_dev(dip);
return (DDI_SUCCESS);
@@ -893,9 +892,11 @@ fail_drive_info:
static int
bd_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
{
- bd_t *bd;
+ bd_handle_t hdl;
+ bd_t *bd;
bd = ddi_get_driver_private(dip);
+ hdl = ddi_get_parent_data(dip);
switch (cmd) {
case DDI_DETACH:
@@ -907,6 +908,8 @@ bd_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
return (DDI_FAILURE);
}
+ hdl->h_bd = NULL;
+
if (bd->d_ksp != NULL) {
kstat_delete(bd->d_ksp);
bd->d_ksp = NULL;