From 7a6e4c815547be64c594ec0919998d0315925a5f Mon Sep 17 00:00:00 2001 From: JerryH1011 Date: Mon, 19 Jul 2021 14:37:36 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=85=B1?= =?UTF-8?q?=E4=BA=AB=E5=86=85=E5=AD=98shmat=E5=92=8Cshmdt=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B9=8B=E9=97=B4=E5=AD=98=E5=9C=A8=E7=9A=84=E6=AD=BB?= =?UTF-8?q?=E9=94=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #I40QOM Change-Id: Ib3783f5d6b1095bf2100ab024fe0235a64355823 Signed-off-by: JerryH1011 --- kernel/base/vm/shm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/base/vm/shm.c b/kernel/base/vm/shm.c index 577eb160..035a456f 100644 --- a/kernel/base/vm/shm.c +++ b/kernel/base/vm/shm.c @@ -742,6 +742,7 @@ INT32 ShmDt(const VOID *shmaddr) /* remove it from aspace */ LOS_RbDelNode(&space->regionRbTree, ®ion->rbNode); LOS_ArchMmuUnmap(&space->archMmu, region->range.base, region->range.size >> PAGE_SHIFT); + (VOID)LOS_MuxRelease(&space->regionMux); /* free it */ free(region); @@ -750,7 +751,7 @@ INT32 ShmDt(const VOID *shmaddr) if (seg == NULL) { ret = EINVAL; SYSV_SHM_UNLOCK(); - goto ERROR_WITH_LOCK; + goto ERROR; } ShmPagesRefDec(seg); @@ -763,7 +764,7 @@ INT32 ShmDt(const VOID *shmaddr) seg->ds.shm_lpid = LOS_GetCurrProcessID(); } SYSV_SHM_UNLOCK(); - (VOID)LOS_MuxRelease(&space->regionMux); + return 0; ERROR_WITH_LOCK: -- GitLab