From 936210c0769034e14bd94e74323cf17a4e28f94b Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Mon, 13 May 2013 09:43:46 +0200 Subject: [PATCH] pn53x: only create a current target when at least one have been found. --- libnfc/chips/pn53x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 795aef0..04af6dc 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1271,10 +1271,11 @@ pn53x_initiator_select_dep_target(struct nfc_device *pnd, } else { res = pn53x_InJumpForDEP(pnd, ndm, nbr, pbtPassiveInitiatorData, NULL, NULL, 0, pnt, timeout); } - if (res >= 0) + if (res > 0) { if (pn53x_current_target_new(pnd, pnt) == NULL) { return NFC_ESOFT; } + } return res; }