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:
parent
7a30e35496
commit
9a0a10826b
1 changed files with 5 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue