Bluetooth: Remove unneeded locking
authorAndre Guedes <andre.guedes@openbossa.org>
Fri, 27 Jan 2012 22:42:03 +0000 (19:42 -0300)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 13 Feb 2012 15:01:30 +0000 (17:01 +0200)
We don't need locking hdev in hci_conn_timeout() since it doesn't
access any hdev's shared resources, it basically queues HCI commands.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Reviewed-by: Ulisses Furquim <ulisses@profusion.mobi>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
net/bluetooth/hci_conn.c

index 7b38a0ba8765351cef6ead90d6b13e76365cf78c..67c94c4dfc3c440ff4d03e6515ad733863756d9e 100644 (file)
@@ -280,7 +280,6 @@ static void hci_conn_timeout(struct work_struct *work)
 {
        struct hci_conn *conn = container_of(work, struct hci_conn,
                                                        disc_work.work);
-       struct hci_dev *hdev = conn->hdev;
        __u8 reason;
 
        BT_DBG("conn %p state %d", conn, conn->state);
@@ -288,8 +287,6 @@ static void hci_conn_timeout(struct work_struct *work)
        if (atomic_read(&conn->refcnt))
                return;
 
-       hci_dev_lock(hdev);
-
        switch (conn->state) {
        case BT_CONNECT:
        case BT_CONNECT2:
@@ -309,8 +306,6 @@ static void hci_conn_timeout(struct work_struct *work)
                conn->state = BT_CLOSED;
                break;
        }
-
-       hci_dev_unlock(hdev);
 }
 
 /* Enter sniff mode */