This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / net / netrom / nr_in.c
index 7de7f0d..e272aff 100644 (file)
@@ -74,6 +74,7 @@ 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);
@@ -102,6 +103,8 @@ static int nr_state1_machine(struct sock *sk, struct sk_buff *skb,
        default:
                break;
        }
+       bh_unlock_sock(sk);
+
        return 0;
 }
 
@@ -113,6 +116,7 @@ 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);
@@ -128,6 +132,8 @@ static int nr_state2_machine(struct sock *sk, struct sk_buff *skb,
        default:
                break;
        }
+       bh_unlock_sock(sk);
+
        return 0;
 }
 
@@ -148,6 +154,7 @@ 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);
@@ -258,10 +265,12 @@ static int nr_state3_machine(struct sock *sk, struct sk_buff *skb, int frametype
        default:
                break;
        }
+       bh_unlock_sock(sk);
+
        return queued;
 }
 
-/* Higher level upcall for a LAPB frame - called with sk locked */
+/* Higher level upcall for a LAPB frame */
 int nr_process_rx_frame(struct sock *sk, struct sk_buff *skb)
 {
        nr_cb *nr = nr_sk(sk);