aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/allowedips.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/allowedips.c')
-rw-r--r--src/allowedips.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/allowedips.c b/src/allowedips.c
index 14f8e13..fab15ad 100644
--- a/src/allowedips.c
+++ b/src/allowedips.c
@@ -255,7 +255,7 @@ static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *be_key,
if (!rcu_access_pointer(*trie)) {
node = kzalloc(sizeof(*node), GFP_KERNEL);
- if (!node)
+ if (unlikely(!node))
return -ENOMEM;
RCU_INIT_POINTER(node->peer, peer);
copy_and_assign_cidr(node, key, cidr, bits);
@@ -268,7 +268,7 @@ static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *be_key,
}
newnode = kzalloc(sizeof(*newnode), GFP_KERNEL);
- if (!newnode)
+ if (unlikely(!newnode))
return -ENOMEM;
RCU_INIT_POINTER(newnode->peer, peer);
copy_and_assign_cidr(newnode, key, cidr, bits);
@@ -295,7 +295,7 @@ static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *be_key,
newnode);
} else {
node = kzalloc(sizeof(*node), GFP_KERNEL);
- if (!node) {
+ if (unlikely(!node)) {
kfree(newnode);
return -ENOMEM;
}