summaryrefslogtreecommitdiffstats
path: root/kernel/include
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2014-11-03 17:35:30 +0100
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>2014-11-03 17:35:30 +0100
commitf87083ee9cf7417a76105f26ef705426cc551e3b (patch)
treef365be1e0871c9692f80d8e7da78fda84e711e41 /kernel/include
parent1a628a64bd76e6ff1666b6cafe5ad55788997883 (diff)
net: use the new API kvfree()
It is available since v3.15-rc5. Cc: Pablo Neira Ayuso <pablo@netfilter.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/linux/netfilter/ipset/ip_set_compat.h.in11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
index 0966289..d38197c 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
@@ -35,6 +35,7 @@
#@HAVE_NET_OPS_ID@ HAVE_NET_OPS_ID
#@HAVE_USER_NS_IN_STRUCT_NET@ HAVE_USER_NS_IN_STRUCT_NET
#@HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE@ HAVE_RBTREE_POSTORDER_FOR_EACH_ENTRY_SAFE
+#@HAVE_KVFREE@ HAVE_KVFREE
/* Not everything could be moved here. Compatibility stuffs can be found in
* xt_set.c, ip_set_core.c, ip_set_getport.c, pfxlen.c too.
@@ -115,6 +116,16 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
#define unlock_nfnl() nfnl_unlock()
#endif
+#ifndef HAVE_KVFREE
+static inline void kvfree(const void *addr)
+{
+ if (is_vmalloc_addr(addr))
+ vfree(addr);
+ else
+ kfree(addr);
+}
+#endif
+
#ifdef NLA_PUT_NET16
static inline int nla_put_be16(struct sk_buff *skb, int attrtype, __be16 value)
{