connector.c (00f5e06c032507206c4ac0c846ad82b75ae7665b) | connector.c (b7c6ba6eb1234e35a74fb8ba8123232a7b1ba9e4) |
---|---|
1/* 2 * connector.c 3 * 4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 5 * All rights reserved. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 406 unchanged lines hidden (view full) --- 415 dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, 416 CN_NETLINK_USERS + 0xf, 417 dev->input, NULL, THIS_MODULE); 418 if (!dev->nls) 419 return -EIO; 420 421 dev->cbdev = cn_queue_alloc_dev("cqueue", dev->nls); 422 if (!dev->cbdev) { | 1/* 2 * connector.c 3 * 4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 5 * All rights reserved. 6 * 7 * This program is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by --- 406 unchanged lines hidden (view full) --- 415 dev->nls = netlink_kernel_create(&init_net, NETLINK_CONNECTOR, 416 CN_NETLINK_USERS + 0xf, 417 dev->input, NULL, THIS_MODULE); 418 if (!dev->nls) 419 return -EIO; 420 421 dev->cbdev = cn_queue_alloc_dev("cqueue", dev->nls); 422 if (!dev->cbdev) { |
423 if (dev->nls->sk_socket) 424 sock_release(dev->nls->sk_socket); | 423 netlink_kernel_release(dev->nls); |
425 return -EINVAL; 426 } 427 428 cn_already_initialized = 1; 429 430 err = cn_add_callback(&dev->id, "connector", &cn_callback); 431 if (err) { 432 cn_already_initialized = 0; 433 cn_queue_free_dev(dev->cbdev); | 424 return -EINVAL; 425 } 426 427 cn_already_initialized = 1; 428 429 err = cn_add_callback(&dev->id, "connector", &cn_callback); 430 if (err) { 431 cn_already_initialized = 0; 432 cn_queue_free_dev(dev->cbdev); |
434 if (dev->nls->sk_socket) 435 sock_release(dev->nls->sk_socket); | 433 netlink_kernel_release(dev->nls); |
436 return -EINVAL; 437 } 438 439 return 0; 440} 441 442static void __devexit cn_fini(void) 443{ 444 struct cn_dev *dev = &cdev; 445 446 cn_already_initialized = 0; 447 448 cn_del_callback(&dev->id); 449 cn_queue_free_dev(dev->cbdev); | 434 return -EINVAL; 435 } 436 437 return 0; 438} 439 440static void __devexit cn_fini(void) 441{ 442 struct cn_dev *dev = &cdev; 443 444 cn_already_initialized = 0; 445 446 cn_del_callback(&dev->id); 447 cn_queue_free_dev(dev->cbdev); |
450 if (dev->nls->sk_socket) 451 sock_release(dev->nls->sk_socket); | 448 netlink_kernel_release(dev->nls); |
452} 453 454subsys_initcall(cn_init); 455module_exit(cn_fini); | 449} 450 451subsys_initcall(cn_init); 452module_exit(cn_fini); |