diff options
author | kib <kib@FreeBSD.org> | 2013-03-19 13:10:14 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-03-19 13:10:14 +0000 |
commit | 3277788fe197a3ba880c621e594737ccbd6566e6 (patch) | |
tree | 717c55e69b6144d9d97b677ea4dd34343e67aacc /sys/cam/cam_periph.c | |
parent | 2ccefecf014b43b06dedf686cbf5b53081d4bf59 (diff) | |
download | FreeBSD-src-3277788fe197a3ba880c621e594737ccbd6566e6.zip FreeBSD-src-3277788fe197a3ba880c621e594737ccbd6566e6.tar.gz |
Assert that a ccb passed to cam_periph_mapmem() for XPT_SCSI_IO and
XPT_ATA_IO holds virtual buffer address.
Sponsored by: The FreeBSD Foundation
Tested by: pho
Diffstat (limited to 'sys/cam/cam_periph.c')
-rw-r--r-- | sys/cam/cam_periph.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 523e549..9ef359c 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -734,6 +734,8 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) case XPT_CONT_TARGET_IO: if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) return(0); + KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR, + ("not VADDR for SCSI_IO %p %x\n", ccb, ccb->ccb_h.flags)); data_ptrs[0] = &ccb->csio.data_ptr; lengths[0] = ccb->csio.dxfer_len; @@ -743,6 +745,8 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) case XPT_ATA_IO: if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_NONE) return(0); + KASSERT((ccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR, + ("not VADDR for ATA_IO %p %x\n", ccb, ccb->ccb_h.flags)); data_ptrs[0] = &ccb->ataio.data_ptr; lengths[0] = ccb->ataio.dxfer_len; |