projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4d6a218
)
[Bluetooth] Handle device registration failures
author
Marcel Holtmann
<marcel@holtmann.org>
Mon, 8 Jan 2007 01:16:38 +0000
(
02:16
+0100)
committer
David S. Miller
<davem@sunset.davemloft.net>
Tue, 9 Jan 2007 08:29:56 +0000
(
00:29
-0800)
In the case the device registration for a new Bluetooth low-level
connection fails there is no need to unregister it when the temporary
data structure has been removed.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_sysfs.c
patch
|
blob
|
blame
|
history
diff --git
a/net/bluetooth/hci_sysfs.c
b/net/bluetooth/hci_sysfs.c
index d4c935692ccfe377d8fde81e297ab8cb458a7655..801d687ea4efbdf84d7b6982a5dda5607c2d9644 100644
(file)
--- a/
net/bluetooth/hci_sysfs.c
+++ b/
net/bluetooth/hci_sysfs.c
@@
-242,7
+242,7
@@
static void add_conn(struct work_struct *work)
struct hci_conn *conn = container_of(work, struct hci_conn, work);
int i;
- if (device_
register
(&conn->dev) < 0) {
+ if (device_
add
(&conn->dev) < 0) {
BT_ERR("Failed to register connection device");
return;
}
@@
-272,6
+272,8
@@
void hci_conn_add_sysfs(struct hci_conn *conn)
dev_set_drvdata(&conn->dev, conn);
+ device_initialize(&conn->dev);
+
INIT_WORK(&conn->work, add_conn);
schedule_work(&conn->work);
@@
-287,6
+289,9
@@
void hci_conn_del_sysfs(struct hci_conn *conn)
{
BT_DBG("conn %p", conn);
+ if (!device_is_registered(&conn->dev))
+ return;
+
INIT_WORK(&conn->work, del_conn);
schedule_work(&conn->work);