From 820b8a47200af1669bec737a9251fc7a794b01f4 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Wed, 28 Jun 2023 06:41:39 +0530 Subject: [PATCH] Moved status check before setting atomic variable --- src/protocols/secure_channel/CASESession.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocols/secure_channel/CASESession.cpp b/src/protocols/secure_channel/CASESession.cpp index 76c2097c6340bb..3876e023fe70c6 100644 --- a/src/protocols/secure_channel/CASESession.cpp +++ b/src/protocols/secure_channel/CASESession.cpp @@ -242,9 +242,9 @@ class CASESession::WorkHelper { // We failed to schedule after work callback, so setting mScheduleAfterWorkFailed flag to true // This can be checked from foreground thread and after work callback can be retried + helper->mStatus = status; ChipLogError(SecureChannel, "Failed to Schedule the AfterWorkCallback on foreground thread"); helper->mScheduleAfterWorkFailed.store(true); - helper->mStatus = status; // Release strong ptr since scheduling failed helper->mStrongPtr.reset();