From a7fc1bddafab6518ee300e6ba81f5bd2e4542098 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Fri, 6 Dec 2013 16:03:00 +0100 Subject: [PATCH] Fix nfc_target_init() timeout return This patch prevent from returning a successfull error code while timeout occurred. Thanks to blck on forum: http://www.libnfc.org/community/post/4913/#p4913 --- libnfc/chips/pn53x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 0cedca8..edd9ecf 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1911,7 +1911,7 @@ pn53x_target_init(struct nfc_device *pnd, nfc_target *pnt, uint8_t *pbtRx, const if ((res = pn53x_TgInitAsTarget(pnd, ptm, pbtMifareParams, pbtTkt, szTkt, pbtFeliCaParams, pbtNFCID3t, pbtGBt, szGBt, pbtRx, szRxLen, &btActivatedMode, timeout)) < 0) { if (res == NFC_ETIMEOUT) { - return pn53x_idle(pnd); + pn53x_idle(pnd); } return res; }