diff options
-rw-r--r-- | net/core/sock.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index b32b1815ae5a..ac63b56e23b2 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1529,6 +1529,8 @@ EXPORT_SYMBOL(proto_register); | |||
1529 | void proto_unregister(struct proto *prot) | 1529 | void proto_unregister(struct proto *prot) |
1530 | { | 1530 | { |
1531 | write_lock(&proto_list_lock); | 1531 | write_lock(&proto_list_lock); |
1532 | list_del(&prot->node); | ||
1533 | write_unlock(&proto_list_lock); | ||
1532 | 1534 | ||
1533 | if (prot->slab != NULL) { | 1535 | if (prot->slab != NULL) { |
1534 | kmem_cache_destroy(prot->slab); | 1536 | kmem_cache_destroy(prot->slab); |
@@ -1550,9 +1552,6 @@ void proto_unregister(struct proto *prot) | |||
1550 | kfree(name); | 1552 | kfree(name); |
1551 | prot->twsk_slab = NULL; | 1553 | prot->twsk_slab = NULL; |
1552 | } | 1554 | } |
1553 | |||
1554 | list_del(&prot->node); | ||
1555 | write_unlock(&proto_list_lock); | ||
1556 | } | 1555 | } |
1557 | 1556 | ||
1558 | EXPORT_SYMBOL(proto_unregister); | 1557 | EXPORT_SYMBOL(proto_unregister); |