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
This commit is contained in:
Romuald Conty 2013-12-06 16:03:00 +01:00
parent 4817a6e5c9
commit a7fc1bddaf

View file

@ -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;
}