diff options
author | Sunil Jogi <sunil.jogi@nxp.com> | 2012-01-27 12:01:04 -0800 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2012-01-30 10:03:19 -0800 |
commit | 2ee71571ead17d435e9d9e8be300edd5d45333b7 (patch) | |
tree | 34e02c581454d00f6b117c223b5a43fe600d470d | |
parent | 4bbf618b661ce7787efab168dd106115268fd539 (diff) | |
download | external_libnfc-nxp-2ee71571ead17d435e9d9e8be300edd5d45333b7.zip external_libnfc-nxp-2ee71571ead17d435e9d9e8be300edd5d45333b7.tar.gz external_libnfc-nxp-2ee71571ead17d435e9d9e8be300edd5d45333b7.tar.bz2 |
Fixed wrong callbacks call
Call the callback only if the context is not null.
Change-Id: I783d9e8ddedb2546eff85837826703db189f9f59
-rw-r--r-- | src/phFriNfc_LlcpMacNfcip.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/phFriNfc_LlcpMacNfcip.c b/src/phFriNfc_LlcpMacNfcip.c index 6fc7cf6..611571a 100644 --- a/src/phFriNfc_LlcpMacNfcip.c +++ b/src/phFriNfc_LlcpMacNfcip.c @@ -104,9 +104,9 @@ static NFCSTATUS phFriNfc_LlcpMac_Nfcip_Chk(phFriNfc_LlcpMac_t { status = PHNFCSTVAL(CID_FRI_NFC_LLCP_MAC, NFCSTATUS_FAILED); } + ChkLlcpMac_Cb(pContext,status); } - ChkLlcpMac_Cb(pContext,status); return status; } @@ -142,29 +142,27 @@ static NFCSTATUS phFriNfc_LlcpMac_Nfcip_Deactivate (phFriNfc_LlcpMac_t *LlcpMa { /* Set the flag of LinkStatus to deactivate */ LlcpMac->LinkState = phFriNfc_LlcpMac_eLinkDeactivated; - } - - if (LlcpMac->SendPending) - { - /* Reset Flag */ - LlcpMac->SendPending = FALSE; - phFriNfc_LlcpMac_Nfcip_TriggerSendCb(LlcpMac, NFCSTATUS_FAILED); - } + if (LlcpMac->SendPending) + { + /* Reset Flag */ + LlcpMac->SendPending = FALSE; + phFriNfc_LlcpMac_Nfcip_TriggerSendCb(LlcpMac, NFCSTATUS_FAILED); + } - if (LlcpMac->RecvPending) - { - /* Reset Flag */ - LlcpMac->RecvPending = FALSE; + if (LlcpMac->RecvPending) + { + /* Reset Flag */ + LlcpMac->RecvPending = FALSE; + phFriNfc_LlcpMac_Nfcip_TriggerRecvCb(LlcpMac, NFCSTATUS_FAILED); + } - phFriNfc_LlcpMac_Nfcip_TriggerRecvCb(LlcpMac, NFCSTATUS_FAILED); + LlcpMac->LinkStatus_Cb(LlcpMac->LinkStatus_Context, + LlcpMac->LinkState, + NULL, + LlcpMac->PeerRemoteDevType); } - LlcpMac->LinkStatus_Cb(LlcpMac->LinkStatus_Context, - LlcpMac->LinkState, - NULL, - LlcpMac->PeerRemoteDevType); - return status; } |