diff --git a/kernel/base/ipc/los_sem.c b/kernel/base/ipc/los_sem.c index 31d484a15d0bca96e5f8d3e77dcc28b135a0f988..fea68fcafdac66519532949549de0aeb677e4f44 100644 --- a/kernel/base/ipc/los_sem.c +++ b/kernel/base/ipc/los_sem.c @@ -246,7 +246,7 @@ LITE_OS_SEC_TEXT UINT32 OsSemPostUnsafe(UINT32 semHandle, BOOL *needSched) /* Update the operate time, no matter the actual Post success or not */ OsSemDbgTimeUpdateHook(semHandle); - if (semPosted->semCount == OS_SEM_COUNT_MAX) { + if (semPosted->semCount == semPosted->maxSemCount) { return LOS_ERRNO_SEM_OVERFLOW; } if (!LOS_ListEmpty(&semPosted->semList)) {