summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/device.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/device.c b/src/device.c
index efa2ee8..1504169 100644
--- a/src/device.c
+++ b/src/device.c
@@ -68,9 +68,7 @@ static int clear_noise_peer(struct wireguard_peer *peer, void *data)
static int suspending_clear_noise_peers(struct notifier_block *nb, unsigned long action, void *data)
{
struct wireguard_device *wg = container_of(nb, struct wireguard_device, clear_peers_on_suspend);
- switch (action) {
- case PM_HIBERNATION_PREPARE:
- case PM_SUSPEND_PREPARE:
+ if (action == PM_HIBERNATION_PREPARE || action == PM_SUSPEND_PREPARE) {
peer_for_each(wg, clear_noise_peer, NULL);
rcu_barrier();
}