Index: mpt_raid.c =================================================================== RCS file: /usr/cvs/src/sys/dev/mpt/mpt_raid.c,v retrieving revision 1.17 diff -u -r1.17 mpt_raid.c --- mpt_raid.c 2 May 2008 17:02:35 -0000 1.17 +++ mpt_raid.c 11 Jul 2008 00:21:23 -0000 @@ -52,6 +52,7 @@ #include #include #include +#include #include #if __FreeBSD_version < 500000 @@ -657,17 +658,18 @@ mpt_cam_rescan_callback(struct cam_periph *periph, union ccb *ccb) { xpt_free_path(ccb->ccb_h.path); - free(ccb, M_DEVBUF); } static void mpt_raid_thread(void *arg) { struct mpt_softc *mpt; + union ccb *ccb; int firstrun; mpt = (struct mpt_softc *)arg; firstrun = 1; + ccb = xpt_alloc_ccb(); MPT_LOCK(mpt); while (mpt->shutdwn_raid == 0) { @@ -695,18 +697,15 @@ } if (mpt->raid_rescan != 0) { - union ccb *ccb; struct cam_path *path; int error; mpt->raid_rescan = 0; - ccb = malloc(sizeof(*ccb), M_DEVBUF, M_WAITOK); error = xpt_create_path(&path, xpt_periph, cam_sim_path(mpt->phydisk_sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (error != CAM_REQ_CMP) { - free(ccb, M_DEVBUF); mpt_prt(mpt, "Unable to rescan RAID Bus!\n"); } else { xpt_setup_ccb(&ccb->ccb_h, path, 5); @@ -719,6 +719,7 @@ } } } + xpt_free_ccb(ccb); mpt->raid_thread = NULL; wakeup(&mpt->raid_thread); MPT_UNLOCK(mpt);