aboutsummaryrefslogtreecommitdiff
path: root/sys/cam
diff options
context:
space:
mode:
authorThomas Quinot <thomas@FreeBSD.org>2003-10-08 07:12:30 +0000
committerThomas Quinot <thomas@FreeBSD.org>2003-10-08 07:12:30 +0000
commit28cd624700783466dc0fdf5eb8d6ebe758fa86a2 (patch)
treec95616ba831ed9ac93a85599f44d6456e666606d /sys/cam
parent8afcf0cc36324052cc77779687e083550ef67920 (diff)
Notes
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/scsi/scsi_da.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 20afef9adcd1..884e9488d59c 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -89,7 +89,8 @@ typedef enum {
DA_FLAG_NEED_OTAG = 0x020,
DA_FLAG_WENT_IDLE = 0x040,
DA_FLAG_RETRY_UA = 0x080,
- DA_FLAG_OPEN = 0x100
+ DA_FLAG_OPEN = 0x100,
+ DA_FLAG_SCTX_INIT = 0x200
} da_flags;
typedef enum {
@@ -838,7 +839,8 @@ dacleanup(struct cam_periph *periph)
/*
* If we can't free the sysctl tree, oh well...
*/
- if (sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
+ if ((softc->flags & DA_FLAG_SCTX_INIT) != 0
+ && sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
xpt_print_path(periph->path);
printf("can't remove sysctl context\n");
}
@@ -925,6 +927,7 @@ dasysctlinit(void *context, int pending)
mtx_lock(&Giant);
sysctl_ctx_init(&softc->sysctl_ctx);
+ softc->flags |= DA_FLAG_SCTX_INIT;
softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2,
CTLFLAG_RD, 0, tmpstr);