From b7c8a7976f404afa621652a96d3280f3a6174e9d Mon Sep 17 00:00:00 2001 From: Yaroslav Tykhiy Date: Fri, 29 Nov 2002 15:40:10 +0000 Subject: 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 --- sys/cam/scsi/scsi_da.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 6e07d1c9a31f8..55fa578cc13f8 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); -- cgit v1.3