diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 13:14:14 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 13:14:14 +0300 |
commit | cd5b27c9e334ff91ec39647957a3bdf75f171938 (patch) | |
tree | 88a95929dde4232e34c61206d24f29ee79d7b34c /net/packet | |
parent | 7b9069cd1859ed8d1c5c757ca21ec787f75f0029 (diff) | |
parent | 880e4ff5d6c8dc6b660f163a0e9b68b898cc6310 (diff) | |
download | linux-rolling-lts.tar.xz |
Merge v6.12.42linux-rolling-lts
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/packet')
-rw-r--r-- | net/packet/af_packet.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 19c4c1f27e58..e8589fede4d4 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -4562,10 +4562,10 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, spin_lock(&po->bind_lock); was_running = packet_sock_flag(po, PACKET_SOCK_RUNNING); num = po->num; - if (was_running) { - WRITE_ONCE(po->num, 0); + WRITE_ONCE(po->num, 0); + if (was_running) __unregister_prot_hook(sk, false); - } + spin_unlock(&po->bind_lock); synchronize_net(); @@ -4597,10 +4597,10 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u, mutex_unlock(&po->pg_vec_lock); spin_lock(&po->bind_lock); - if (was_running) { - WRITE_ONCE(po->num, num); + WRITE_ONCE(po->num, num); + if (was_running) register_prot_hook(sk); - } + spin_unlock(&po->bind_lock); if (pg_vec && (po->tp_version > TPACKET_V2)) { /* Because we don't support block-based V3 on tx-ring */ |