diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-28 23:41:19 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-29 00:08:07 +0100 |
commit | b7c6ba6eb1234e35a74fb8ba8123232a7b1ba9e4 (patch) | |
tree | 672c08c95229a6ac242ab12a5195dceddb0f3127 /drivers/connector | |
parent | [NETNS]: Memory leak on network namespace stop. (diff) | |
download | linux-b7c6ba6eb1234e35a74fb8ba8123232a7b1ba9e4.tar.xz linux-b7c6ba6eb1234e35a74fb8ba8123232a7b1ba9e4.zip |
[NETNS]: Consolidate kernel netlink socket destruction.
Create a specific helper for netlink kernel socket disposal. This just
let the code look better and provides a ground for proper disposal
inside a namespace.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Tested-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/connector')
-rw-r--r-- | drivers/connector/connector.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index 37976dcf044b..fea2d3ed9cbd 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c @@ -420,8 +420,7 @@ static int __devinit cn_init(void) dev->cbdev = cn_queue_alloc_dev("cqueue", dev->nls); if (!dev->cbdev) { - if (dev->nls->sk_socket) - sock_release(dev->nls->sk_socket); + netlink_kernel_release(dev->nls); return -EINVAL; } @@ -431,8 +430,7 @@ static int __devinit cn_init(void) if (err) { cn_already_initialized = 0; cn_queue_free_dev(dev->cbdev); - if (dev->nls->sk_socket) - sock_release(dev->nls->sk_socket); + netlink_kernel_release(dev->nls); return -EINVAL; } @@ -447,8 +445,7 @@ static void __devexit cn_fini(void) cn_del_callback(&dev->id); cn_queue_free_dev(dev->cbdev); - if (dev->nls->sk_socket) - sock_release(dev->nls->sk_socket); + netlink_kernel_release(dev->nls); } subsys_initcall(cn_init); |