summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-07-07 18:11:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-07-07 18:11:33 +0200
commit55b48b3b6f5e2a07ed1f3f36b652c5a0fd3a266c (patch)
tree7112aae2af16102a857c9d04b7ef108e804a3d5b
parentsocket: style (diff)
downloadwireguard-monolithic-historical-55b48b3b6f5e2a07ed1f3f36b652c5a0fd3a266c.tar.xz
wireguard-monolithic-historical-55b48b3b6f5e2a07ed1f3f36b652c5a0fd3a266c.zip
compat: work around odd kernels that backport kvfree
-rw-r--r--src/compat/compat.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h
index 8d9038a..a80039d 100644
--- a/src/compat/compat.h
+++ b/src/compat/compat.h
@@ -326,13 +326,15 @@ static inline void *kvzalloc(size_t size, gfp_t flags)
#if ((LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0)) || LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 41)) && !defined(ISUBUNTU1404)
#include <linux/vmalloc.h>
-static inline void kvfree(const void *addr)
+#include <linux/mm.h>
+static inline void kvfree_ours(const void *addr)
{
if (is_vmalloc_addr(addr))
vfree(addr);
else
kfree(addr);
}
+#define kvfree kvfree_ours
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 9)