Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174020184
D60148.id188130.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60148.id188130.diff
View Options
diff --git a/usr.bin/mkimg/image.c b/usr.bin/mkimg/image.c
--- a/usr.bin/mkimg/image.c
+++ b/usr.bin/mkimg/image.c
@@ -330,10 +330,11 @@
}
static int
-image_file_unmap(void *buffer, size_t sz)
+image_file_unmap(void *buffer, size_t sz, off_t iof)
{
size_t unit;
+ sz += iof;
unit = (secsz > image_swap_pgsz) ? secsz : image_swap_pgsz;
sz = (sz + unit - 1) & ~(unit - 1);
if (madvise(buffer, sz, MADV_DONTNEED) != 0)
@@ -381,7 +382,7 @@
error = errno;
else
error = 0;
- image_file_unmap(buffer, iosz);
+ image_file_unmap(buffer, iosz, iof);
/* XXX should we relinguish unused swap space? */
if (error)
return (error);
@@ -465,7 +466,7 @@
buf += iof;
error = image_chunk_copyin(blk, buf,
sz, data, fd);
- image_file_unmap(mp, sz);
+ image_file_unmap(mp, sz, iof);
} else
error = errno;
@@ -590,7 +591,7 @@
return (errno);
buf += iof;
error = image_copyout_memory(fd, sz, buf);
- image_file_unmap(mp, sz);
+ image_file_unmap(mp, sz, iof);
if (error)
return (error);
size -= sz;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 1, 12:49 AM (2 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
39971699
Default Alt Text
D60148.id188130.diff (1 KB)
Attached To
Mode
D60148: mkimg: Avoid leaking a page of mmap
Attached
Detach File
Event Timeline
Log In to Comment