summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-09-10 18:23:43 +0000
committeralc <alc@FreeBSD.org>2003-09-10 18:23:43 +0000
commit95675dad3fed41f61a02f2309ed23a88634d450f (patch)
tree86ccc77c06f46ff653e838c2aca07cc80b861aa6 /sys/cam
parentc286d7e22fa5381ba769004bba1634b51fc739bd (diff)
downloadFreeBSD-src-95675dad3fed41f61a02f2309ed23a88634d450f.zip
FreeBSD-src-95675dad3fed41f61a02f2309ed23a88634d450f.tar.gz
In case vmapbuf() fails, release all of the held resources.
Submitted by: tegge
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_periph.c8
1 files changed, 3 insertions, 5 deletions
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);
}
OpenPOWER on IntegriCloud