aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth D. Merry <ken@FreeBSD.org>2003-03-26 04:38:39 +0000
committerKenneth D. Merry <ken@FreeBSD.org>2003-03-26 04:38:39 +0000
commit461dddba27c5624bdf8b4ce08866e476a00a4fc2 (patch)
tree55fcde982310d70b959e99a3fccd476d3eacebc9 /sys
parent15d8f3d44748b81aefe79cc737e725ad35537d84 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/scsi/scsi_cd.c6
-rw-r--r--sys/cam/scsi/scsi_da.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index bda6b7b8a666..66b18f0d8ac1 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -455,6 +455,11 @@ cdcleanup(struct cam_periph *periph)
xpt_print_path(periph->path);
printf("removing device entry\n");
+ if (sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
+ xpt_print_path(periph->path);
+ printf("can't remove sysctl context\n");
+ }
+
s = splsoftcam();
/*
* In the queued, non-active case, the device in question
@@ -688,6 +693,7 @@ cdregister(struct cam_periph *periph, void *arg)
snprintf(tmpstr, sizeof(tmpstr), "CAM CD unit %d", periph->unit_number);
snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
+ sysctl_ctx_init(&softc->sysctl_ctx);
softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO,
tmpstr2, CTLFLAG_RD, 0, tmpstr);
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 4007d29ca828..bdb827654e78 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -987,6 +987,13 @@ dacleanup(struct cam_periph *periph)
xpt_print_path(periph->path);
printf("removing device entry\n");
+ /*
+ * If we can't free the sysctl tree, oh well...
+ */
+ if (sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
+ xpt_print_path(periph->path);
+ printf("can't remove sysctl context\n");
+ }
disk_destroy(&softc->disk);
free(softc, M_DEVBUF);
}
@@ -1142,6 +1149,7 @@ daregister(struct cam_periph *periph, void *arg)
snprintf(tmpstr, sizeof(tmpstr), "CAM DA unit %d", periph->unit_number);
snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number);
+ sysctl_ctx_init(&softc->sysctl_ctx);
softc->sysctl_tree = SYSCTL_ADD_NODE(&softc->sysctl_ctx,
SYSCTL_STATIC_CHILDREN(_kern_cam_da), OID_AUTO, tmpstr2,
CTLFLAG_RD, 0, tmpstr);