From 470a0c58d85d451cadae663c3a1d8c8c2538ef31 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 19 Sep 2018 04:06:27 +0200 Subject: allowedips: change from BUG_ON to WARN_ON This is never going to hit anyway, and if it does, it's a development problem that will be caught with the selftests anyway. So don't make Andrew Lunn upset, and just change it to a WARN_ON. Suggested-by: Andrew Lunn --- src/allowedips.c | 4 ++-- src/selftest/allowedips.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/allowedips.c b/src/allowedips.c index 5681c2a..7202469 100644 --- a/src/allowedips.c +++ b/src/allowedips.c @@ -50,7 +50,7 @@ static void node_free_rcu(struct rcu_head *rcu) #define push_rcu(stack, p, len) ({ \ if (rcu_access_pointer(p)) { \ - BUG_ON(len >= 128); \ + WARN_ON(len >= 128); \ stack[len++] = rcu_dereference_raw(p); \ } \ true; \ @@ -109,7 +109,7 @@ walk_by_peer(struct allowedips_node __rcu *top, u8 bits, #define ref(p) rcu_access_pointer(p) #define deref(p) rcu_dereference_protected(*p, lockdep_is_held(lock)) #define push(p) ({ \ - BUG_ON(len >= 128); \ + WARN_ON(len >= 128); \ stack[len++] = p; \ }) static void walk_remove_by_peer(struct allowedips_node __rcu **top, diff --git a/src/selftest/allowedips.h b/src/selftest/allowedips.h index 83cfb34..dc04543 100644 --- a/src/selftest/allowedips.h +++ b/src/selftest/allowedips.h @@ -600,7 +600,7 @@ bool __init allowedips_selftest(void) allowedips_remove_by_peer(&t, a, &mutex); test_negative(4, a, 192, 168, 0, 1); - /* These will hit the BUG_ON(len >= 128) in free_node if something goes wrong. */ + /* These will hit the WARN_ON(len >= 128) in free_node if something goes wrong. */ for (i = 0; i < 128; ++i) { part = cpu_to_be64(~(1LLU << (i % 64))); memset(&ip, 0xff, 16); -- cgit v1.2.3-59-g8ed1b