From 2ee71571ead17d435e9d9e8be300edd5d45333b7 Mon Sep 17 00:00:00 2001 From: Sunil Jogi Date: Fri, 27 Jan 2012 12:01:04 -0800 Subject: Fixed wrong callbacks call Call the callback only if the context is not null. Change-Id: I783d9e8ddedb2546eff85837826703db189f9f59 --- src/phFriNfc_LlcpMacNfcip.c | 36 +++++++++++++++++------------------- 1 file 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; } -- cgit v1.1