diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-02-24 13:36:51 -0500 |
---|---|---|
committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2013-03-08 08:38:44 -0500 |
commit | 5e9d7f868f04106139a58212b860dcdc268ad3af (patch) | |
tree | b18a22bb524431c882d39e425297fc0c9adf8b86 | |
parent | fd86c9becc1154ee5643caafedf7cbdf8241c176 (diff) |
Bluetooth: discard bt_sock_unregister() errors
After we successfully registered a socket via bt_sock_register() there is
no reason to ever check the return code of bt_sock_unregister(). If
bt_sock_unregister() fails, it means the socket _is_ already unregistered
so we have what we want, don't we?
Also, to get bt_sock_unregister() to fail, another part of the kernel has
to unregister _our_ socket. This is sooo _wrong_ that it will break way
earlier than when we unregister our socket.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
-rw-r--r-- | net/bluetooth/bnep/sock.c | 4 | ||||
-rw-r--r-- | net/bluetooth/cmtp/sock.c | 4 | ||||
-rw-r--r-- | net/bluetooth/hci_sock.c | 4 | ||||
-rw-r--r-- | net/bluetooth/hidp/sock.c | 4 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 4 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 3 | ||||
-rw-r--r-- | net/bluetooth/sco.c | 3 |
7 files changed, 7 insertions, 19 deletions
diff --git a/net/bluetooth/bnep/sock.c b/net/bluetooth/bnep/sock.c index e7154a58465f..5b1c04e28821 100644 --- a/net/bluetooth/bnep/sock.c +++ b/net/bluetooth/bnep/sock.c | |||
@@ -253,8 +253,6 @@ error: | |||
253 | void __exit bnep_sock_cleanup(void) | 253 | void __exit bnep_sock_cleanup(void) |
254 | { | 254 | { |
255 | bt_procfs_cleanup(&init_net, "bnep"); | 255 | bt_procfs_cleanup(&init_net, "bnep"); |
256 | if (bt_sock_unregister(BTPROTO_BNEP) < 0) | 256 | bt_sock_unregister(BTPROTO_BNEP); |
257 | BT_ERR("Can't unregister BNEP socket"); | ||
258 | |||
259 | proto_unregister(&bnep_proto); | 257 | proto_unregister(&bnep_proto); |
260 | } | 258 | } |
diff --git a/net/bluetooth/cmtp/sock.c b/net/bluetooth/cmtp/sock.c index 1c57482112b6..58d9edebab4b 100644 --- a/net/bluetooth/cmtp/sock.c +++ b/net/bluetooth/cmtp/sock.c | |||
@@ -264,8 +264,6 @@ error: | |||
264 | void cmtp_cleanup_sockets(void) | 264 | void cmtp_cleanup_sockets(void) |
265 | { | 265 | { |
266 | bt_procfs_cleanup(&init_net, "cmtp"); | 266 | bt_procfs_cleanup(&init_net, "cmtp"); |
267 | if (bt_sock_unregister(BTPROTO_CMTP) < 0) | 267 | bt_sock_unregister(BTPROTO_CMTP); |
268 | BT_ERR("Can't unregister CMTP socket"); | ||
269 | |||
270 | proto_unregister(&cmtp_proto); | 268 | proto_unregister(&cmtp_proto); |
271 | } | 269 | } |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 6a93614f2c49..ec044d31f79c 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -1121,8 +1121,6 @@ error: | |||
1121 | void hci_sock_cleanup(void) | 1121 | void hci_sock_cleanup(void) |
1122 | { | 1122 | { |
1123 | bt_procfs_cleanup(&init_net, "hci"); | 1123 | bt_procfs_cleanup(&init_net, "hci"); |
1124 | if (bt_sock_unregister(BTPROTO_HCI) < 0) | 1124 | bt_sock_unregister(BTPROTO_HCI); |
1125 | BT_ERR("HCI socket unregistration failed"); | ||
1126 | |||
1127 | proto_unregister(&hci_sk_proto); | 1125 | proto_unregister(&hci_sk_proto); |
1128 | } | 1126 | } |
diff --git a/net/bluetooth/hidp/sock.c b/net/bluetooth/hidp/sock.c index 82a829d90b0f..5d0f1ca0a314 100644 --- a/net/bluetooth/hidp/sock.c +++ b/net/bluetooth/hidp/sock.c | |||
@@ -304,8 +304,6 @@ error: | |||
304 | void __exit hidp_cleanup_sockets(void) | 304 | void __exit hidp_cleanup_sockets(void) |
305 | { | 305 | { |
306 | bt_procfs_cleanup(&init_net, "hidp"); | 306 | bt_procfs_cleanup(&init_net, "hidp"); |
307 | if (bt_sock_unregister(BTPROTO_HIDP) < 0) | 307 | bt_sock_unregister(BTPROTO_HIDP); |
308 | BT_ERR("Can't unregister HIDP socket"); | ||
309 | |||
310 | proto_unregister(&hidp_proto); | 308 | proto_unregister(&hidp_proto); |
311 | } | 309 | } |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 1bcfb8422fdc..7f9704993b74 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -1312,8 +1312,6 @@ error: | |||
1312 | void l2cap_cleanup_sockets(void) | 1312 | void l2cap_cleanup_sockets(void) |
1313 | { | 1313 | { |
1314 | bt_procfs_cleanup(&init_net, "l2cap"); | 1314 | bt_procfs_cleanup(&init_net, "l2cap"); |
1315 | if (bt_sock_unregister(BTPROTO_L2CAP) < 0) | 1315 | bt_sock_unregister(BTPROTO_L2CAP); |
1316 | BT_ERR("L2CAP socket unregistration failed"); | ||
1317 | |||
1318 | proto_unregister(&l2cap_proto); | 1316 | proto_unregister(&l2cap_proto); |
1319 | } | 1317 | } |
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index c23bae86263b..3786ddc45152 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -1065,8 +1065,7 @@ void __exit rfcomm_cleanup_sockets(void) | |||
1065 | 1065 | ||
1066 | debugfs_remove(rfcomm_sock_debugfs); | 1066 | debugfs_remove(rfcomm_sock_debugfs); |
1067 | 1067 | ||
1068 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) | 1068 | bt_sock_unregister(BTPROTO_RFCOMM); |
1069 | BT_ERR("RFCOMM socket layer unregistration failed"); | ||
1070 | 1069 | ||
1071 | proto_unregister(&rfcomm_proto); | 1070 | proto_unregister(&rfcomm_proto); |
1072 | } | 1071 | } |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 79d87d8d4f51..0a3aeb7e0aa6 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -1111,8 +1111,7 @@ void __exit sco_exit(void) | |||
1111 | 1111 | ||
1112 | debugfs_remove(sco_debugfs); | 1112 | debugfs_remove(sco_debugfs); |
1113 | 1113 | ||
1114 | if (bt_sock_unregister(BTPROTO_SCO) < 0) | 1114 | bt_sock_unregister(BTPROTO_SCO); |
1115 | BT_ERR("SCO socket unregistration failed"); | ||
1116 | 1115 | ||
1117 | proto_unregister(&sco_proto); | 1116 | proto_unregister(&sco_proto); |
1118 | } | 1117 | } |