Alike to SCSI make adaclose() to not return error if device gone.

This fixes KASSERT panic inside GEOM if kernel built with INVARIANTS.

MFC after:	1 week
This commit is contained in:
Alexander Motin 2012-04-18 08:55:26 +00:00
parent 70c4c58519
commit 6f48792444
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=234414

View File

@ -456,17 +456,16 @@ adaclose(struct disk *dp)
struct cam_periph *periph;
struct ada_softc *softc;
union ccb *ccb;
int error;
periph = (struct cam_periph *)dp->d_drv1;
if (periph == NULL)
return (ENXIO);
cam_periph_lock(periph);
if ((error = cam_periph_hold(periph, PRIBIO)) != 0) {
if (cam_periph_hold(periph, PRIBIO) != 0) {
cam_periph_unlock(periph);
cam_periph_release(periph);
return (error);
return (0);
}
softc = (struct ada_softc *)periph->softc;