diff options
| author | Gavin Atkinson <gavin@FreeBSD.org> | 2009-12-31 12:58:08 +0000 |
|---|---|---|
| committer | Gavin Atkinson <gavin@FreeBSD.org> | 2009-12-31 12:58:08 +0000 |
| commit | d36f5405ca1a94cb870499e42ee91f2f1924f758 (patch) | |
| tree | a1dcb6b29523df812da6da8345b2ae56f60502ed /sys/dev/ciss | |
| parent | e6b37c3a7f61eb56d1190833d01f1b6ec2ccce44 (diff) | |
Notes
Diffstat (limited to 'sys/dev/ciss')
| -rw-r--r-- | sys/dev/ciss/ciss.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 39836ea7ea70..c5ad417e70c8 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -418,6 +418,7 @@ ciss_attach(device_t dev) sc = device_get_softc(dev); sc->ciss_dev = dev; + mtx_init(&sc->ciss_mtx, "cissmtx", NULL, MTX_DEF); /* * Do PCI-specific init. @@ -430,7 +431,6 @@ ciss_attach(device_t dev) */ ciss_initq_free(sc); ciss_initq_notify(sc); - mtx_init(&sc->ciss_mtx, "cissmtx", NULL, MTX_DEF); callout_init_mtx(&sc->ciss_periodic, &sc->ciss_mtx, 0); /* @@ -496,8 +496,11 @@ ciss_attach(device_t dev) error = 0; out: - if (error != 0) + if (error != 0) { + /* ciss_free() expects the mutex to be held */ + mtx_lock(&sc->ciss_mtx); ciss_free(sc); + } return(error); } |
