aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-10-15 11:30:45 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-10-16 02:14:28 -0400
commitdf5c37ea9a3820a9515d8204450aec00f48f8f88 (patch)
tree0a7ca311e03be7738ae9e2bcbd3c43c7b8f9cf74
parente9c5702e3c5558dade169949abd730173e87ef9c (diff)
[Bluetooth] Handle return values from driver core functions
Some return values of the driver core register and create functions are not handled and so might cause unexpected problems. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_sysfs.c11
-rw-r--r--net/bluetooth/l2cap.c3
-rw-r--r--net/bluetooth/rfcomm/core.c3
-rw-r--r--net/bluetooth/rfcomm/sock.c3
-rw-r--r--net/bluetooth/sco.c3
5 files changed, 16 insertions, 7 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 989b22d9042e..c7e079d3c486 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -242,10 +242,14 @@ static void add_conn(void *data)
242 struct hci_conn *conn = data; 242 struct hci_conn *conn = data;
243 int i; 243 int i;
244 244
245 device_register(&conn->dev); 245 if (device_register(&conn->dev) < 0) {
246 BT_ERR("Failed to register connection device");
247 return;
248 }
246 249
247 for (i = 0; conn_attrs[i]; i++) 250 for (i = 0; conn_attrs[i]; i++)
248 device_create_file(&conn->dev, conn_attrs[i]); 251 if (device_create_file(&conn->dev, conn_attrs[i]) < 0)
252 BT_ERR("Failed to create connection attribute");
249} 253}
250 254
251void hci_conn_add_sysfs(struct hci_conn *conn) 255void hci_conn_add_sysfs(struct hci_conn *conn)
@@ -312,7 +316,8 @@ int hci_register_sysfs(struct hci_dev *hdev)
312 return err; 316 return err;
313 317
314 for (i = 0; bt_attrs[i]; i++) 318 for (i = 0; bt_attrs[i]; i++)
315 device_create_file(dev, bt_attrs[i]); 319 if (device_create_file(dev, bt_attrs[i]) < 0)
320 BT_ERR("Failed to create device attribute");
316 321
317 return 0; 322 return 0;
318} 323}
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index d56f60b392ac..66fc621a077c 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2216,7 +2216,8 @@ static int __init l2cap_init(void)
2216 goto error; 2216 goto error;
2217 } 2217 }
2218 2218
2219 class_create_file(bt_class, &class_attr_l2cap); 2219 if (class_create_file(bt_class, &class_attr_l2cap) < 0)
2220 BT_ERR("Failed to create L2CAP info file");
2220 2221
2221 BT_INFO("L2CAP ver %s", VERSION); 2222 BT_INFO("L2CAP ver %s", VERSION);
2222 BT_INFO("L2CAP socket layer initialized"); 2223 BT_INFO("L2CAP socket layer initialized");
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 468df3b953f6..ddc4e9d5963e 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -2058,7 +2058,8 @@ static int __init rfcomm_init(void)
2058 2058
2059 kernel_thread(rfcomm_run, NULL, CLONE_KERNEL); 2059 kernel_thread(rfcomm_run, NULL, CLONE_KERNEL);
2060 2060
2061 class_create_file(bt_class, &class_attr_rfcomm_dlc); 2061 if (class_create_file(bt_class, &class_attr_rfcomm_dlc) < 0)
2062 BT_ERR("Failed to create RFCOMM info file");
2062 2063
2063 rfcomm_init_sockets(); 2064 rfcomm_init_sockets();
2064 2065
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 220fee04e7f2..530cc41f3a22 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -944,7 +944,8 @@ int __init rfcomm_init_sockets(void)
944 if (err < 0) 944 if (err < 0)
945 goto error; 945 goto error;
946 946
947 class_create_file(bt_class, &class_attr_rfcomm); 947 if (class_create_file(bt_class, &class_attr_rfcomm) < 0)
948 BT_ERR("Failed to create RFCOMM info file");
948 949
949 BT_INFO("RFCOMM socket layer initialized"); 950 BT_INFO("RFCOMM socket layer initialized");
950 951
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 7714a2ec3854..14b0f6930637 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -967,7 +967,8 @@ static int __init sco_init(void)
967 goto error; 967 goto error;
968 } 968 }
969 969
970 class_create_file(bt_class, &class_attr_sco); 970 if (class_create_file(bt_class, &class_attr_sco) < 0)
971 BT_ERR("Failed to create SCO info file");
971 972
972 BT_INFO("SCO (Voice Link) ver %s", VERSION); 973 BT_INFO("SCO (Voice Link) ver %s", VERSION);
973 BT_INFO("SCO socket layer initialized"); 974 BT_INFO("SCO socket layer initialized");