Message ID | 1266592584.3136.41.camel@edumazet-laptop |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 10f7295..b706031 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1271,15 +1271,15 @@ static int packet_release(struct socket *sock) * Unhook packet receive handler. */ + spin_lock(&po->bind_lock); if (po->running) { - /* - * Remove the protocol hook - */ - dev_remove_pack(&po->prot_hook); + __sock_put(sk); po->running = 0; po->num = 0; - __sock_put(sk); - } + spin_unlock(&po->bind_lock); + dev_remove_pack(&po->prot_hook); + } else + spin_unlock(&po->bind_lock); packet_flush_mclist(sk);