]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/bluetooth/rfcomm/core.c
Pull error-inject into release branch
[linux-2.6-omap-h63xx.git] / net / bluetooth / rfcomm / core.c
index 94f45736056085a901c78f7208781e67d465602c..fe7df90eb7077ca5b1ea3440623418c220a69ea6 100644 (file)
@@ -1567,7 +1567,7 @@ static int rfcomm_recv_frame(struct rfcomm_session *s, struct sk_buff *skb)
 
        /* Trim FCS */
        skb->len--; skb->tail--;
-       fcs = *(u8 *) skb->tail;
+       fcs = *(u8 *)skb_tail_pointer(skb);
 
        if (__check_fcs(skb->data, type, fcs)) {
                BT_ERR("bad checksum in packet");
@@ -1851,18 +1851,18 @@ static void rfcomm_worker(void)
        BT_DBG("");
 
        while (!atomic_read(&terminate)) {
+               set_current_state(TASK_INTERRUPTIBLE);
                if (!test_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event)) {
                        /* No pending events. Let's sleep.
                         * Incoming connections and data will wake us up. */
-                       set_current_state(TASK_INTERRUPTIBLE);
                        schedule();
                }
+               set_current_state(TASK_RUNNING);
 
                /* Process stuff */
                clear_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event);
                rfcomm_process_sessions();
        }
-       set_current_state(TASK_RUNNING);
        return;
 }