diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-04 11:18:09 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-04 11:18:58 -0600 |
commit | 32d43304abbe9a8546a0c453b7f358a359e4467a (patch) | |
tree | ab42a47a8ecd2fae1d8ed64c5bc2479ac8d7161f /src/selftest/ratelimiter.h | |
parent | global: prefer sizeof(*pointer) when possible (diff) | |
download | wireguard-monolithic-historical-32d43304abbe9a8546a0c453b7f358a359e4467a.tar.xz wireguard-monolithic-historical-32d43304abbe9a8546a0c453b7f358a359e4467a.zip |
global: always find OOM unlikely
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | src/selftest/ratelimiter.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/selftest/ratelimiter.h b/src/selftest/ratelimiter.h index 1f2b697..f9f9996 100644 --- a/src/selftest/ratelimiter.h +++ b/src/selftest/ratelimiter.h @@ -59,7 +59,7 @@ bool __init ratelimiter_selftest(void) ++test; skb4 = alloc_skb(sizeof(struct iphdr), GFP_KERNEL); - if (!skb4) + if (unlikely(!skb4)) goto err_nofree; skb4->protocol = htons(ETH_P_IP); hdr4 = (struct iphdr *)skb_put(skb4, sizeof(*hdr4)); @@ -69,7 +69,7 @@ bool __init ratelimiter_selftest(void) #if IS_ENABLED(CONFIG_IPV6) skb6 = alloc_skb(sizeof(struct ipv6hdr), GFP_KERNEL); - if (!skb6) { + if (unlikely(!skb6)) { kfree_skb(skb4); goto err_nofree; } |