From e766e1a2953695fc1d45ce319399be6629a7a5f0 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sat, 7 Jan 2012 15:47:07 +0100 Subject: [PATCH] --- yaml --- r: 290849 b: refs/heads/master c: 010666a126fce7b9ecdda7209c558db21d771c56 h: refs/heads/master i: 290847: 092cb0aff3f48fe9839e92b0ecf58a1e9dc9eccf v: v3 --- [refs] | 2 +- trunk/include/net/bluetooth/hci_core.h | 6 ++++-- trunk/net/bluetooth/hci_core.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 471c0268cb8f..e05a1872ce2e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5a0b8159e1c65ce25382d3f5189b6a462422f065 +refs/heads/master: 010666a126fce7b9ecdda7209c558db21d771c56 diff --git a/trunk/include/net/bluetooth/hci_core.h b/trunk/include/net/bluetooth/hci_core.h index 25a6c3fd7d1a..86c74cc563ff 100644 --- a/trunk/include/net/bluetooth/hci_core.h +++ b/trunk/include/net/bluetooth/hci_core.h @@ -595,8 +595,10 @@ static inline void hci_conn_put(struct hci_conn *conn) /* ----- HCI Devices ----- */ static inline void __hci_dev_put(struct hci_dev *d) { - if (atomic_dec_and_test(&d->refcnt)) - d->destruct(d); + if (atomic_dec_and_test(&d->refcnt)) { + if (d->destruct) + d->destruct(d); + } } /* diff --git a/trunk/net/bluetooth/hci_core.c b/trunk/net/bluetooth/hci_core.c index f84935e5cbab..f23e32a645c8 100644 --- a/trunk/net/bluetooth/hci_core.c +++ b/trunk/net/bluetooth/hci_core.c @@ -1551,7 +1551,7 @@ int hci_register_dev(struct hci_dev *hdev) BT_DBG("%p name %s bus %d owner %p", hdev, hdev->name, hdev->bus, hdev->owner); - if (!hdev->open || !hdev->close || !hdev->destruct) + if (!hdev->open || !hdev->close) return -EINVAL; /* Do not allow HCI_AMP devices to register at index 0,