Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
vppinfra: introduce clib_mem_vm_ext_free() to avoid fd leaks
[vpp.git]
/
src
/
vppinfra
/
linux
/
mem.c
diff --git
a/src/vppinfra/linux/mem.c
b/src/vppinfra/linux/mem.c
index
bceb3b2
..
2d968fa
100644
(file)
--- a/
src/vppinfra/linux/mem.c
+++ b/
src/vppinfra/linux/mem.c
@@
-252,6
+252,17
@@
done:
return err;
}
return err;
}
+void
+clib_mem_vm_ext_free (clib_mem_vm_alloc_t * a)
+{
+ if (a != 0)
+ {
+ clib_mem_vm_free (a->addr, 1 << a->log2_page_size);
+ if (a->fd != -1)
+ close (a->fd);
+ }
+}
+
u64 *
clib_mem_vm_get_paddr (void *mem, int log2_page_size, int n_pages)
{
u64 *
clib_mem_vm_get_paddr (void *mem, int log2_page_size, int n_pages)
{