From d205cfa65acdde02ea2a3b96279045ee54e5c7b0 Mon Sep 17 00:00:00 2001 From: arvinzzz Date: Tue, 26 Apr 2022 18:25:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=9B=E7=A8=8B=E9=80=80=E5=87=BA?= =?UTF-8?q?=E5=90=8E=E8=8E=B7=E5=8F=96=E5=85=B6=E8=B0=83=E5=BA=A6=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: arvinzzz Change-Id: I0e98fef07e4919a5fbb051899ecb45a224225f91 --- kernel/base/core/los_process.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/base/core/los_process.c b/kernel/base/core/los_process.c index 135bdf3f..2ceb2fb2 100644 --- a/kernel/base/core/los_process.c +++ b/kernel/base/core/los_process.c @@ -995,7 +995,6 @@ LITE_OS_SEC_TEXT INT32 LOS_SetProcessPriority(INT32 pid, UINT16 prio) LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid) { - INT32 prio; UINT32 intSave; SchedParam param = { 0 }; (VOID)which; @@ -1011,14 +1010,13 @@ LITE_OS_SEC_TEXT INT32 OsGetProcessPriority(INT32 which, INT32 pid) LosProcessCB *processCB = OS_PCB_FROM_PID(pid); SCHEDULER_LOCK(intSave); if (OsProcessIsUnused(processCB)) { - prio = -LOS_ESRCH; - goto OUT; + SCHEDULER_UNLOCK(intSave); + return -LOS_ESRCH; } LosTaskCB *taskCB = OS_TCB_FROM_TID(processCB->threadGroupID); taskCB->ops->schedParamGet(taskCB, ¶m); -OUT: SCHEDULER_UNLOCK(intSave); return param.basePrio; } -- GitLab