From 5630038faf48c6c087270d55030dc07f332e4da2 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Fri, 13 Jan 2012 09:56:53 -0800 Subject: 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 --- src/phFriNfc_Llcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.1