summaryrefslogtreecommitdiff
path: root/sys/scsi/st.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/scsi/st.c')
-rw-r--r--sys/scsi/st.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/scsi/st.c b/sys/scsi/st.c
index f59332646fc..0a8ebae947b 100644
--- a/sys/scsi/st.c
+++ b/sys/scsi/st.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: st.c,v 1.77 2007/11/16 11:28:34 deraadt Exp $ */
+/* $OpenBSD: st.c,v 1.78 2007/11/22 03:19:50 krw Exp $ */
/* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */
/*
@@ -1130,17 +1130,18 @@ stioctl(dev, cmd, arg, flag, p)
struct mtop *mt = (struct mtop *) arg;
int number;
- if (st->flags & ST_DYING) {
- device_unref(&st->sc_dev);
- return (ENXIO);
- }
-
/*
* Find the device that the user is talking about
*/
flags = 0; /* give error messages, act on errors etc. */
unit = STUNIT(dev);
st = st_cd.cd_devs[unit];
+
+ if (st->flags & ST_DYING) {
+ device_unref(&st->sc_dev);
+ return (ENXIO);
+ }
+
hold_blksize = st->blksize;
hold_density = st->density;