diff options
author | trasz <trasz@FreeBSD.org> | 2008-12-16 17:01:52 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2008-12-16 17:01:52 +0000 |
commit | a06a1075a6719e0d49495a44becc791ba9f37bbc (patch) | |
tree | 719d1bc292042a30707867306b2d3f39c863c635 /sys/cam/scsi | |
parent | 1aa4ea9cfb2dc8da2c82c6b4f27eee1e40c731be (diff) | |
download | FreeBSD-src-a06a1075a6719e0d49495a44becc791ba9f37bbc.zip FreeBSD-src-a06a1075a6719e0d49495a44becc791ba9f37bbc.tar.gz |
Fix locking in periph drivers - don't try to unlock periph
that was already deallocated.
Reviewed by: scottl
Approved by: rwatson (mentor)
Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index f63a9b0..3e1b233 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -772,8 +772,8 @@ daclose(struct disk *dp) softc->flags &= ~DA_FLAG_OPEN; cam_periph_unhold(periph); - cam_periph_release(periph); cam_periph_unlock(periph); + cam_periph_release(periph); return (0); } @@ -995,10 +995,8 @@ dacleanup(struct cam_periph *periph) xpt_print(periph->path, "can't remove sysctl context\n"); } - cam_periph_unlock(periph); disk_destroy(softc->disk); callout_drain(&softc->sendordered_c); - cam_periph_lock(periph); free(softc, M_DEVBUF); } |