summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1999-04-23 23:25:48 +0000
committergibbs <gibbs@FreeBSD.org>1999-04-23 23:25:48 +0000
commit4bdf5acb03450b66b7441f9f3798283c3ac624c6 (patch)
tree0df1fd4fdc179e0daefa8ec121ac68e7e76788fe /sys/cam
parent7bc6edd2550a562e1f4ed8098bd1aab634b4ac22 (diff)
downloadFreeBSD-src-4bdf5acb03450b66b7441f9f3798283c3ac624c6.zip
FreeBSD-src-4bdf5acb03450b66b7441f9f3798283c3ac624c6.tar.gz
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.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 3ed8344..59c5883 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 <sys/param.h>
#include <sys/systm.h>
@@ -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);
OpenPOWER on IntegriCloud