diff options
Diffstat (limited to 'net/bluetooth/rfcomm/sock.c')
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 1a17850d093c..b3226f3658cf 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -1035,8 +1035,17 @@ int __init rfcomm_init_sockets(void) | |||
1035 | return err; | 1035 | return err; |
1036 | 1036 | ||
1037 | err = bt_sock_register(BTPROTO_RFCOMM, &rfcomm_sock_family_ops); | 1037 | err = bt_sock_register(BTPROTO_RFCOMM, &rfcomm_sock_family_ops); |
1038 | if (err < 0) | 1038 | if (err < 0) { |
1039 | BT_ERR("RFCOMM socket layer registration failed"); | ||
1040 | goto error; | ||
1041 | } | ||
1042 | |||
1043 | err = bt_procfs_init(THIS_MODULE, &init_net, "rfcomm", &rfcomm_sk_list, NULL); | ||
1044 | if (err < 0) { | ||
1045 | BT_ERR("Failed to create RFCOMM proc file"); | ||
1046 | bt_sock_unregister(BTPROTO_RFCOMM); | ||
1039 | goto error; | 1047 | goto error; |
1048 | } | ||
1040 | 1049 | ||
1041 | if (bt_debugfs) { | 1050 | if (bt_debugfs) { |
1042 | rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444, | 1051 | rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444, |
@@ -1050,13 +1059,14 @@ int __init rfcomm_init_sockets(void) | |||
1050 | return 0; | 1059 | return 0; |
1051 | 1060 | ||
1052 | error: | 1061 | error: |
1053 | BT_ERR("RFCOMM socket layer registration failed"); | ||
1054 | proto_unregister(&rfcomm_proto); | 1062 | proto_unregister(&rfcomm_proto); |
1055 | return err; | 1063 | return err; |
1056 | } | 1064 | } |
1057 | 1065 | ||
1058 | void __exit rfcomm_cleanup_sockets(void) | 1066 | void __exit rfcomm_cleanup_sockets(void) |
1059 | { | 1067 | { |
1068 | bt_procfs_cleanup(&init_net, "rfcomm"); | ||
1069 | |||
1060 | debugfs_remove(rfcomm_sock_debugfs); | 1070 | debugfs_remove(rfcomm_sock_debugfs); |
1061 | 1071 | ||
1062 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) | 1072 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) |