Date: Fri, 28 Mar 2003 00:27:42 GMT From: Tor.Egge@cvsup.no.freebsd.org To: freebsd-scsi@freebsd.org Subject: incomplete cleanup after failed vmapbuf() in cam_periph_mapmem() Message-ID: <20030328002742F.tegge@cvsup.no.freebsd.org>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
The cleanup after a failed vmapbuf() in cam_periph_mapmem() seems to
be incomplete. Buffers that have already been successfully mapped are
not unmapped before being released. The buffer that could not be
mapped is not released.
A suggested fix is enclosed.
- Tor Egge
[-- Attachment #2 --]
Index: sys/cam/cam_periph.c
===================================================================
RCS file: /home/ncvs/src/sys/cam/cam_periph.c,v
retrieving revision 1.47
diff -u -r1.47 cam_periph.c
--- sys/cam/cam_periph.c 15 Mar 2003 21:59:05 -0000 1.47
+++ sys/cam/cam_periph.c 28 Mar 2003 00:17:37 -0000
@@ -675,9 +675,12 @@
(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);
}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030328002742F.tegge>
