Search Linux Wireless

[PATCH 2/3] NFC: Fix ret check in nfc_shdlc_connect_complete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Typically, the r argument passed to nfc_shdlc_connect_complete()
comes from xmit() cb which returns, in successfull usecase, number
of successfully transmited bytes. Therefore, e.g. sending UA frame
the shdlc will go into wrong state (DISCONNECTED insted of CONNECTED).

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@xxxxxxxxx>
---
 net/nfc/hci/shdlc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/nfc/hci/shdlc.c b/net/nfc/hci/shdlc.c
index fe66cbc..12feb58 100644
--- a/net/nfc/hci/shdlc.c
+++ b/net/nfc/hci/shdlc.c
@@ -309,7 +309,7 @@ static void nfc_shdlc_connect_complete(struct nfc_shdlc *shdlc, int r)
 
 	del_timer_sync(&shdlc->connect_timer);
 
-	if (r == 0) {
+	if (r >= 0) {
 		shdlc->ns = 0;
 		shdlc->nr = 0;
 		shdlc->dnr = 0;
-- 
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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux