All of lore.kernel.org
 help / color / mirror / Atom feed
From: Colin Ian King <colin.king@canonical.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Bluetooth USB: fix kernel panic during suspend - 2.6.24
Date: Fri, 13 Feb 2009 09:49:45 +0000	[thread overview]
Message-ID: <1234518585.6647.26.camel@ubuntu> (raw)


The kernel panics when hci_usb_tx_complete() calls _urb_unlink()
on an _urb which has been previously been removed from a list.
This occurs during suspend while audio is being streamed to
a bluetooth headset.

The panic occurs because hci_usb_suspend() dequeues _urb
and then calls usb_kill_urb() - instead it should put _urb on
the killed list first before killing the urb.

Also added a spin_lock around the list_add operation.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/bluetooth/hci_usb.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index cf734ca..22fd5b5 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -1029,8 +1029,10 @@ static int hci_usb_suspend(struct usb_interface
*intf, pm_message_t message)
 		while ((_urb = _urb_dequeue(q))) {
 			/* reset queue since _urb_dequeue sets it to NULL */
 			_urb->queue = q;
-			usb_kill_urb(&_urb->urb);
+			spin_lock_irqsave(&q->lock, flags);
 			list_add(&_urb->list, &killed);
+			spin_unlock_irqrestore(&q->lock, flags);
+			usb_kill_urb(&_urb->urb);
 		}
 
 		spin_lock_irqsave(&q->lock, flags);
-- 


             reply	other threads:[~2009-02-13  9:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-13  9:49 Colin Ian King [this message]
2009-02-13 19:09 ` [PATCH] Bluetooth USB: fix kernel panic during suspend - 2.6.24 Greg KH
2009-02-14 12:53   ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1234518585.6647.26.camel@ubuntu \
    --to=colin.king@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.