summaryrefslogtreecommitdiff
path: root/sys/dev/sdmmc/sdmmc_scsi.c
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2009-04-07 16:35:53 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2009-04-07 16:35:53 +0000
commit46c923d7e1e7be08bd5c46dad9463af9b60e6112 (patch)
tree18e7ebdb635b265a96b017504cab9ef2df7532b8 /sys/dev/sdmmc/sdmmc_scsi.c
parent25b4f988f32e1078e0e1b91d955f72c093c76b6f (diff)
Remove recursion from the sdmmc locking regime.
In snaps for a while. Originally hacked on phessler@'s couch. Testing by many, input from jsg@ "I'm tired of seeing the Ms" deraadt@
Diffstat (limited to 'sys/dev/sdmmc/sdmmc_scsi.c')
-rw-r--r--sys/dev/sdmmc/sdmmc_scsi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/sdmmc/sdmmc_scsi.c b/sys/dev/sdmmc/sdmmc_scsi.c
index 189ede20bf5..4147cfefb37 100644
--- a/sys/dev/sdmmc/sdmmc_scsi.c
+++ b/sys/dev/sdmmc/sdmmc_scsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdmmc_scsi.c,v 1.16 2009/03/24 12:15:34 kettenis Exp $ */
+/* $OpenBSD: sdmmc_scsi.c,v 1.17 2009/04/07 16:35:52 blambert Exp $ */
/*
* Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org>
@@ -99,6 +99,8 @@ sdmmc_scsi_attach(struct sdmmc_softc *sc)
struct sdmmc_scsi_softc *scbus;
struct sdmmc_function *sf;
+ SDMMC_ASSERT_LOCKED(sc);
+
scbus = malloc(sizeof *scbus, M_DEVBUF, M_WAITOK | M_ZERO);
scbus->sc_tgt = malloc(sizeof(*scbus->sc_tgt) *
@@ -159,6 +161,8 @@ sdmmc_scsi_detach(struct sdmmc_softc *sc)
struct sdmmc_ccb *ccb;
int s;
+ SDMMC_ASSERT_LOCKED(sc);
+
scbus = sc->sc_scsibus;
if (scbus == NULL)
return;