ovpn: drop useless reg_state check in keepalive worker
authorAntonio Quartulli <antonio@openvpn.net>
Wed, 30 Apr 2025 00:35:18 +0000 (02:35 +0200)
committerAntonio Quartulli <antonio@openvpn.net>
Thu, 15 May 2025 11:09:36 +0000 (13:09 +0200)
The keepalive worker is cancelled before calling
unregister_netdevice_queue(), therefore it will never
hit a situation where the reg_state can be different
than NETDEV_REGISTERED.

For this reason, checking reg_state is useless and the
condition can be removed.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
drivers/net/ovpn/peer.c

index a37f89fffb02efbb6468d54c93247b170b5d11f6..24eb9d81429ee652d7106db9e0ea7fa60430cce5 100644 (file)
@@ -1353,8 +1353,7 @@ void ovpn_peer_keepalive_work(struct work_struct *work)
        }
 
        /* prevent rearming if the interface is being destroyed */
-       if (next_run > 0 &&
-           READ_ONCE(ovpn->dev->reg_state) == NETREG_REGISTERED) {
+       if (next_run > 0) {
                netdev_dbg(ovpn->dev,
                           "scheduling keepalive work: now=%llu next_run=%llu delta=%llu\n",
                           next_run, now, next_run - now);