During processing incoming RSET frame chip, possibly due to its internal timout, could retrnasmit an another RSET which is next queued for processing in shdlc layer. To avoid processing of those remaining in rcv_q purge the queue. Otherwise it will be handled in CONNECTED state which will result in disconnection. Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@xxxxxxxxx> --- net/nfc/hci/shdlc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/nfc/hci/shdlc.c b/net/nfc/hci/shdlc.c index 12feb58..6ede86c 100644 --- a/net/nfc/hci/shdlc.c +++ b/net/nfc/hci/shdlc.c @@ -381,6 +381,12 @@ static void nfc_shdlc_rcv_u_frame(struct nfc_shdlc *shdlc, shdlc->srej_support = srej_support; r = nfc_shdlc_connect_send_ua(shdlc); nfc_shdlc_connect_complete(shdlc, r); + + if (shdlc->rcv_q.qlen) + /* Handling incoming RSET the chip could issue an another one, + * possibly due to its internal timeout, so we have to make + * sure we won't handle these remaining on the rcv_q */ + skb_queue_purge(&shdlc->rcv_q); } } else if (shdlc->state == SHDLC_CONNECTED) { /* -- 1.7.10 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html