diff options
author | Martijn Coenen <maco@google.com> | 2012-01-13 09:56:53 -0800 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2012-01-13 09:56:53 -0800 |
commit | 5630038faf48c6c087270d55030dc07f332e4da2 (patch) | |
tree | dc3e7ae76b096605cbe78284f9b584cfebd752da | |
parent | a12acb119fa8cda91ca23d191b41b9438402e4d1 (diff) | |
download | external_libnfc-nxp-5630038faf48c6c087270d55030dc07f332e4da2.zip external_libnfc-nxp-5630038faf48c6c087270d55030dc07f332e4da2.tar.gz external_libnfc-nxp-5630038faf48c6c087270d55030dc07f332e4da2.tar.bz2 |
Prevent LLCP stack from deactiving twice.
Some parts of the code reset the state to an operation state,
even if the link has already been shutdown. This allowed for a second
deactivation callback, causing a crash higher up in the stack.
Bug: 5765077
Change-Id: I2f2ac720756353d45d82634d27a3dd9acecae43d
-rw-r--r-- | src/phFriNfc_Llcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/phFriNfc_Llcp.c b/src/phFriNfc_Llcp.c index 2a4fcb4..1f66216 100644 --- a/src/phFriNfc_Llcp.c +++ b/src/phFriNfc_Llcp.c @@ -627,7 +627,7 @@ static void phFriNfc_Llcp_HandleMACLinkDeactivated( phFriNfc_Llcp_t *Llcp ) } /* Reset state */ - Llcp->state = PHFRINFC_LLCP_STATE_CHECKED; + Llcp->state = PHFRINFC_LLCP_STATE_DEACTIVATION; switch (state) { @@ -717,7 +717,7 @@ static void phFriNfc_Llcp_ResetLTO( phFriNfc_Llcp_t *Llcp ) { Llcp->state = PHFRINFC_LLCP_STATE_OPERATION_RECV; } - else + else if (Llcp->state != PHFRINFC_LLCP_STATE_DEACTIVATION) { /* Not yet in OPERATION state, perform first reset */ if (Llcp->eRole == phFriNfc_LlcpMac_ePeerTypeInitiator) |