summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorralf@linux-mips.org <ralf@linux-mips.org>2005-03-18 21:30:08 -0800
committerGreg KH <gregkh@suse.de>2005-05-12 10:00:12 -0700
commitb93fb6d60d1986b16692c0be30edbc3b5d0e6449 (patch)
tree98535b8a7a821312d8e0d7d01788b6ec44604ea6
parent0c29ce37e355dd94d1c1ca62cc496f683ff024a9 (diff)
downloadlinux-stable-b93fb6d60d1986b16692c0be30edbc3b5d0e6449.tar.gz
linux-stable-b93fb6d60d1986b16692c0be30edbc3b5d0e6449.tar.bz2
linux-stable-b93fb6d60d1986b16692c0be30edbc3b5d0e6449.zip
[PATCH] NetROM locking
Fix deadlock in NetROM due to double locking. I was sent the patch by Alan and have doublechecked it. This bug hits Net/ROM users really hard. It's accepted by DaveM - but just too late to make it into 2.6.11. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--net/netrom/nr_in.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/net/netrom/nr_in.c b/net/netrom/nr_in.c
index e272aff648bd..bb2403581876 100644
--- a/net/netrom/nr_in.c
+++ b/net/netrom/nr_in.c
@@ -74,7 +74,6 @@ static int nr_queue_rx_frame(struct sock *sk, struct sk_buff *skb, int more)
static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
int frametype)
{
- bh_lock_sock(sk);
switch (frametype) {
case NR_CONNACK: {
nr_cb *nr = nr_sk(sk);
@@ -103,8 +102,6 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
default:
break;
}
- bh_unlock_sock(sk);
-
return 0;
}
@@ -116,7 +113,6 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
int frametype)
{
- bh_lock_sock(sk);
switch (frametype) {
case NR_CONNACK | NR_CHOKE_FLAG:
nr_disconnect(sk, ECONNRESET);
@@ -132,8 +128,6 @@ static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
default:
break;
}
- bh_unlock_sock(sk);
-
return 0;
}
@@ -154,7 +148,6 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
nr = skb->data[18];
ns = skb->data[17];
- bh_lock_sock(sk);
switch (frametype) {
case NR_CONNREQ:
nr_write_internal(sk, NR_CONNACK);
@@ -265,8 +258,6 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
default:
break;
}
- bh_unlock_sock(sk);
-
return queued;
}