summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/scsi/scsi_base.c')
-rw-r--r--sys/scsi/scsi_base.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index 9164833a213..d0614255c39 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.151 2010/01/04 11:46:17 dlg Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.152 2010/01/07 00:11:15 dlg Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -808,6 +808,14 @@ scsi_xs_sync_done(struct scsi_xfer *xs)
{
struct mutex *cookie = xs->cookie;
+ if (cookie == NULL) {
+#ifdef DIAGNOSTIC
+ sc_print_addr(xs->sc_link);
+ printf("scsi_done already called on xs(%p)\n", xs);
+#endif
+ return;
+ }
+
mtx_enter(cookie);
xs->cookie = NULL;
if (!ISSET(xs->flags, SCSI_NOSLEEP))