summaryrefslogtreecommitdiff
path: root/sys/scsi/safte.c
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2006-10-01 10:42:19 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2006-10-01 10:42:19 +0000
commit2c74780ce5f1897162a4e7ec24c1dea78b33f85e (patch)
tree1f23a184383a91c367b22d49540a6f16ed430b68 /sys/scsi/safte.c
parent0c171c414722971475865221f9b39abd3297b487 (diff)
Free sensors on detach.
ok dlg@
Diffstat (limited to 'sys/scsi/safte.c')
-rw-r--r--sys/scsi/safte.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/scsi/safte.c b/sys/scsi/safte.c
index af60ab70ddd..ea6ef9fd9c8 100644
--- a/sys/scsi/safte.c
+++ b/sys/scsi/safte.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: safte.c,v 1.29 2006/07/29 02:40:45 krw Exp $ */
+/* $OpenBSD: safte.c,v 1.30 2006/10/01 10:42:18 grange Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -221,12 +221,9 @@ safte_detach(struct device *self, int flags)
if (sc->sc_nsensors > 0) {
sensor_task_unregister(sc);
- /*
- * we can't free the sensors since there is no mechanism to
- * take them out of the sensor list. mark them invalid instead.
- */
for (i = 0; i < sc->sc_nsensors; i++)
- sc->sc_sensors[i].se_sensor.flags |= SENSOR_FINVALID;
+ sensor_del(&sc->sc_sensors[i].se_sensor);
+ free(sc->sc_sensors, M_DEVBUF);
}
if (sc->sc_encbuf != NULL)