mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
Like the problems just fixed in scsi_da.c, make sure
to release the probe ccb before taking down the periph. Also, don't do cdscheduling if you're not going to attach the device after all. Reviewed by: ken@freebsd.org
This commit is contained in:
parent
f403e6edea
commit
f55ca80bcf
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42378
@ -24,7 +24,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: scsi_cd.c,v 1.10 1998/12/04 22:54:43 archie Exp $
|
* $Id: scsi_cd.c,v 1.11 1998/12/22 20:05:22 eivind Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Portions of this driver taken from the original FreeBSD cd driver.
|
* Portions of this driver taken from the original FreeBSD cd driver.
|
||||||
@ -1813,14 +1813,23 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(rdcap, M_TEMP);
|
free(rdcap, M_TEMP);
|
||||||
if (announce_buf[0] != '\0')
|
if (announce_buf[0] != '\0') {
|
||||||
xpt_announce_periph(periph, announce_buf);
|
xpt_announce_periph(periph, announce_buf);
|
||||||
softc->state = CD_STATE_NORMAL;
|
|
||||||
if (softc->flags & CD_FLAG_CHANGER)
|
if (softc->flags & CD_FLAG_CHANGER)
|
||||||
cdchangerschedule(softc);
|
cdchangerschedule(softc);
|
||||||
|
}
|
||||||
|
softc->state = CD_STATE_NORMAL;
|
||||||
|
/*
|
||||||
|
* Since our peripheral may be invalidated by an error
|
||||||
|
* above or an external event, we must release our CCB
|
||||||
|
* before releasing the probe lock on the peripheral.
|
||||||
|
* The peripheral will only go away once the last lock
|
||||||
|
* is removed, and we need it around for the CCB release
|
||||||
|
* operation.
|
||||||
|
*/
|
||||||
|
xpt_release_ccb(done_ccb);
|
||||||
cam_periph_unlock(periph);
|
cam_periph_unlock(periph);
|
||||||
|
return;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case CD_CCB_WAITING:
|
case CD_CCB_WAITING:
|
||||||
{
|
{
|
||||||
@ -1831,6 +1840,8 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
|
|||||||
wakeup(&done_ccb->ccb_h.cbfcnp);
|
wakeup(&done_ccb->ccb_h.cbfcnp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
xpt_release_ccb(done_ccb);
|
xpt_release_ccb(done_ccb);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user