From 95675dad3fed41f61a02f2309ed23a88634d450f Mon Sep 17 00:00:00 2001 From: alc Date: Wed, 10 Sep 2003 18:23:43 +0000 Subject: In case vmapbuf() fails, release all of the held resources. Submitted by: tegge --- sys/cam/cam_periph.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/cam') diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 601c781..23a928f 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -653,16 +653,14 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) * vmapbuf() after the useracc() check. */ if (vmapbuf(mapinfo->bp[i]) < 0) { - printf("cam_periph_mapmem: error, " - "address %p, length %lu isn't " - "user accessible any more\n", - (void *)*data_ptrs[i], - (u_long)lengths[i]); for (j = 0; j < i; ++j) { *data_ptrs[j] = mapinfo->bp[j]->b_saveaddr; + vunmapbuf(mapinfo->bp[j]); mapinfo->bp[j]->b_flags &= ~B_PHYS; relpbuf(mapinfo->bp[j], NULL); } + mapinfo->bp[i]->b_flags &= ~B_PHYS; + relpbuf(mapinfo->bp[i], NULL); PRELE(curproc); return(EACCES); } -- cgit v1.1