diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2014-10-29 04:16:00 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-29 11:20:40 -0400 |
commit | 9cfd5a23a49c2a2cb9ff5537128d03547cbd2990 (patch) | |
tree | d71ed5865005e07968443bff66c7bce894ad9f34 /net/bluetooth/hci_core.c | |
parent | e23e9ec16bf4bbaf12fc030079b277cb00f618f4 (diff) |
Bluetooth: Wrong style spin lock used
Use spin_lock_bh() as the code is called from softirq in networking subsystem.
This is needed to prevent deadlocks when 6lowpan link is in use.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r-- | net/bluetooth/hci_core.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index ddf33900f7f3..91995f8ab0a0 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -4661,8 +4661,12 @@ static void hci_queue_acl(struct hci_chan *chan, struct sk_buff_head *queue, | |||
4661 | 4661 | ||
4662 | skb_shinfo(skb)->frag_list = NULL; | 4662 | skb_shinfo(skb)->frag_list = NULL; |
4663 | 4663 | ||
4664 | /* Queue all fragments atomically */ | 4664 | /* Queue all fragments atomically. We need to use spin_lock_bh |
4665 | spin_lock(&queue->lock); | 4665 | * here because of 6LoWPAN links, as there this function is |
4666 | * called from softirq and using normal spin lock could cause | ||
4667 | * deadlocks. | ||
4668 | */ | ||
4669 | spin_lock_bh(&queue->lock); | ||
4666 | 4670 | ||
4667 | __skb_queue_tail(queue, skb); | 4671 | __skb_queue_tail(queue, skb); |
4668 | 4672 | ||
@@ -4679,7 +4683,7 @@ static void hci_queue_acl(struct hci_chan *chan, struct sk_buff_head *queue, | |||
4679 | __skb_queue_tail(queue, skb); | 4683 | __skb_queue_tail(queue, skb); |
4680 | } while (list); | 4684 | } while (list); |
4681 | 4685 | ||
4682 | spin_unlock(&queue->lock); | 4686 | spin_unlock_bh(&queue->lock); |
4683 | } | 4687 | } |
4684 | } | 4688 | } |
4685 | 4689 | ||