diff options
author | Warner Losh <imp@FreeBSD.org> | 2021-06-28 21:59:04 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2021-06-28 21:59:04 +0000 |
commit | d6e7349254e3d26bbecf105be28686a5eb976537 (patch) | |
tree | 8171ba6f2eff3e727520553fbc3e93b723149d6c | |
parent | 1ed401626792b2888e2e29befb13c23ff2273c4e (diff) | |
download | src-d6e7349254e3d26bbecf105be28686a5eb976537.tar.gz src-d6e7349254e3d26bbecf105be28686a5eb976537.zip |
cam mmc: Assert that the xpt_bus_register registered a device_t
Reviewed by: scottl@
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D30854
-rw-r--r-- | sys/cam/mmc/mmc_xpt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/cam/mmc/mmc_xpt.c b/sys/cam/mmc/mmc_xpt.c index 6b2fecdab0fb..c94e74876ed7 100644 --- a/sys/cam/mmc/mmc_xpt.c +++ b/sys/cam/mmc/mmc_xpt.c @@ -406,8 +406,6 @@ mmccam_start_discovery(struct cam_sim *sim) union ccb *ccb; uint32_t pathid; - KASSERT(sim->sim_dev != NULL, ("mmccam_start_discovery(%s): sim_dev is not initialized," - " has cam_sim_alloc_dev() been used?", cam_sim_name(sim))); pathid = cam_sim_path(sim); ccb = xpt_alloc_ccb(); @@ -420,6 +418,10 @@ mmccam_start_discovery(struct cam_sim *sim) xpt_free_ccb(ccb); return; } + + KASSERT(xpt_path_sim_device(&ccb->ccb_h.path) != NULL, + ("%s(%s): device is not initialized on sim's path", + __func__, cam_sim_name(sim))); xpt_rescan(ccb); } |