mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-04-11 00:56:18 +00:00
Fix pn53x_initiator_target_is_present() when saved target is NULL
This patch prevents from running any command to check target presence when none have been saved
This commit is contained in:
@@ -1728,6 +1728,11 @@ pn53x_initiator_deselect_target(struct nfc_device *pnd)
|
||||
int
|
||||
pn53x_initiator_target_is_present(struct nfc_device *pnd, const nfc_target *pnt)
|
||||
{
|
||||
// Check if there is a saved target
|
||||
if (CHIP_DATA(pnd)->current_target == NULL) {
|
||||
return NFC_ETGRELEASED;
|
||||
}
|
||||
|
||||
// Check if the argument target nt is equals to current saved target
|
||||
if ((pnt != NULL) && (!pn53x_current_target_is(pnd, pnt))) {
|
||||
return NFC_ETGRELEASED;
|
||||
|
||||
Reference in New Issue
Block a user