Linux bluetooth development
 help / color / mirror / Atom feed
From: Haijun Liu <haijun.liu@atheros.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Haijun Liu <haijun.liu@atheros.com>
Subject: [PATCH 1/2] Bluetooth: Fix system crash caused by del_timer()
Date: Thu, 21 Oct 2010 15:09:15 +0800	[thread overview]
Message-ID: <1287644956-12602-1-git-send-email-haijun.liu@atheros.com> (raw)

At UPF37, during test session of bt3.0 with Marvel, found that in
l2cap_chan_del() using del_timer() caused l2cap_monitor_timeout()
be called after the sock was freed, so it raised a system crash.
So I just replaced del_timer() with del_timer_sync() to solve it.

Signed-off-by: Haijun Liu <haijun.liu@atheros.com>
---
 net/bluetooth/l2cap.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 6f931cc..879f386 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -283,9 +283,9 @@ static void l2cap_chan_del(struct sock *sk, int err)
 	if (l2cap_pi(sk)->mode == L2CAP_MODE_ERTM) {
 		struct srej_list *l, *tmp;
 
-		del_timer(&l2cap_pi(sk)->retrans_timer);
-		del_timer(&l2cap_pi(sk)->monitor_timer);
-		del_timer(&l2cap_pi(sk)->ack_timer);
+		del_timer_sync(&l2cap_pi(sk)->retrans_timer);
+		del_timer_sync(&l2cap_pi(sk)->monitor_timer);
+		del_timer_sync(&l2cap_pi(sk)->ack_timer);
 
 		skb_queue_purge(SREJ_QUEUE(sk));
 		skb_queue_purge(BUSY_QUEUE(sk));
-- 
1.6.3.3


             reply	other threads:[~2010-10-21  7:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-21  7:09 Haijun Liu [this message]
2010-10-21  7:09 ` [PATCH 2/2] Bluetooth: Fix system crash bug of no send queue protect Haijun Liu
2010-10-26 14:36   ` haijun liu
2010-10-26 14:24 ` [PATCH 1/2] Bluetooth: Fix system crash caused by del_timer() Marcel Holtmann
2010-10-26 14:33   ` haijun liu

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=1287644956-12602-1-git-send-email-haijun.liu@atheros.com \
    --to=haijun.liu@atheros.com \
    --cc=linux-bluetooth@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox