summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2005-11-13 02:21:43 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2005-11-13 02:21:43 +0000
commit8c15ade8affa2520aeeca166f194b4c7a713e051 (patch)
tree48847f2d0969d2a3b2421fa2d6b386fd8e04db39 /sys
parent2b4b9d2b5fd0896a719a50e28eaf097ab70c7ceb (diff)
if the particular ses device has no slots or sensors to handle, then free
all the resources.
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/ses.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/scsi/ses.c b/sys/scsi/ses.c
index bcd33f0de48..97d71c77709 100644
--- a/sys/scsi/ses.c
+++ b/sys/scsi/ses.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ses.c,v 1.29 2005/11/12 08:09:47 dlg Exp $ */
+/* $OpenBSD: ses.c,v 1.30 2005/11/13 02:21:42 dlg Exp $ */
/*
* Copyright (c) 2005 David Gwynne <dlg@openbsd.org>
@@ -189,6 +189,14 @@ ses_attach(struct device *parent, struct device *self, void *aux)
}
#endif
+ if (TAILQ_EMPTY(&sc->sc_sensors)
+#if NBIO > 0
+ && TAILQ_EMPTY(&sc->sc_slots)
+#endif
+ ) {
+ free(sc->sc_buf, M_DEVBUF);
+ sc->sc_buf = NULL;
+ }
}
int