From 9dd03ecf3091d4f3a90e57d09a23c79a32da7c85 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Fri, 23 Apr 1999 23:25:48 +0000 Subject: [PATCH] Release bus entries in the EDT when a path is released. Null out path entries when the path is released to catch bugs. Free our configuration hook when we're done with it. --- sys/cam/cam_xpt.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index 3ed8344d11e..59c5883e1e4 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cam_xpt.c,v 1.52 1999/04/19 21:26:08 gibbs Exp $ + * $Id: cam_xpt.c,v 1.53 1999/04/21 07:26:24 peter Exp $ */ #include #include @@ -3710,10 +3710,18 @@ static void xpt_release_path(struct cam_path *path) { CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_release_path\n")); - if (path->device != NULL) + if (path->device != NULL) { xpt_release_device(path->bus, path->target, path->device); - if (path->target != NULL) + path->device = NULL; + } + if (path->target != NULL) { xpt_release_target(path->bus, path->target); + path->target = NULL; + } + if (path->bus != NULL) { + xpt_release_bus(path->bus); + path->bus = NULL; + } } void @@ -5357,7 +5365,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) * Don't process the command as it was never sent */ } else if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP - && (serial_buf->length > 0)) { + && (serial_buf->length > 0)) { have_serialnum = 1; path->device->serial_num = @@ -5871,6 +5879,8 @@ xpt_finishconfig(struct cam_periph *periph, union ccb *done_ccb) /* Release our hook so that the boot can continue. */ config_intrhook_disestablish(xpt_config_hook); + free(xpt_config_hook, M_TEMP); + xpt_config_hook = NULL; } if (done_ccb != NULL) xpt_free_ccb(done_ccb);