diff options
author | yar <yar@FreeBSD.org> | 2002-11-29 15:40:10 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2002-11-29 15:40:10 +0000 |
commit | 8bfe544f0ac6dbbaab251f97964f8e610ea7579f (patch) | |
tree | f36a1d04414b228561617417a094d75a323197b7 /sys/cam/scsi | |
parent | ad317e456ac255856c6ca59f2436475de98fb737 (diff) | |
download | FreeBSD-src-8bfe544f0ac6dbbaab251f97964f8e610ea7579f.zip FreeBSD-src-8bfe544f0ac6dbbaab251f97964f8e610ea7579f.tar.gz |
Release the reference to the peripheral if returning a error.
That reference is to be held only if daopen() has been successful
and until daclose() releases it. daclose() won't be called if
daopen() has failed, though.
Approved by: re, njl
MFC after: 1 week
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 6e07d1c..55fa578 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -611,6 +611,8 @@ daopen(dev_t dev, int flags __unused, int fmt __unused, struct thread *td __unus if (error == 0) { if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0) daprevent(periph, PR_PREVENT); + } else { + cam_periph_release(periph); } cam_periph_unlock(periph); return (error); |