NFC: Handle RSET in SHDLC_CONNECTING state
authorWaldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Thu, 20 Sep 2012 06:59:11 +0000 (08:59 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 24 Sep 2012 22:17:27 +0000 (00:17 +0200)
As queue_work() does not guarantee immediate execution of sm_work it
can happen in crossover RSET usecase that connect timer will constantly
change the shdlc state from NEGOTIATING to CONNECTING before shdlc has
chance to handle incoming frame.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Acked-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
net/nfc/hci/llc_shdlc.c

index d54bfc51c693fc7b4431c13378ce0ddec078b0da..a7931c7c57f27419145768b5332d0a2b0a5dce41 100644 (file)
@@ -414,7 +414,8 @@ static void llc_shdlc_rcv_u_frame(struct llc_shdlc *shdlc,
 
        switch (u_frame_modifier) {
        case U_FRAME_RSET:
-               if (shdlc->state == SHDLC_NEGOCIATING) {
+               if ((shdlc->state == SHDLC_NEGOCIATING) ||
+                                       (shdlc->state == SHDLC_CONNECTING)) {
                        /* we sent RSET, but chip wants to negociate */
                        if (skb->len > 0)
                                w = skb->data[0];