forked from nuttx/nuttx-update
compiler/tasking: fix NULL pointer reference
ctc E246: ["map/mm_map.c" 67/41] left side of '.' or '->' is not struct or union ctc E260: ["map/mm_map.c" 67/25] not an lvalue ctc E246: ["map/mm_map.c" 80/3] left side of '.' or '->' is not struct or union ctc E260: ["map/mm_map.c" 80/3] not an lvalue Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
parent
ea5210bd40
commit
d133de10e6
1 changed files with 18 additions and 2 deletions
|
@ -64,7 +64,15 @@ static bool in_range(FAR const void *start, size_t length,
|
|||
|
||||
int mm_map_lock(void)
|
||||
{
|
||||
return nxrmutex_lock(&get_current_mm()->mm_map_mutex);
|
||||
FAR struct tcb_s *tcb = nxsched_self();
|
||||
FAR struct task_group_s *group = tcb->group;
|
||||
|
||||
if (group == NULL)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return nxrmutex_lock(&group->tg_mm_map.mm_map_mutex);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -77,7 +85,15 @@ int mm_map_lock(void)
|
|||
|
||||
void mm_map_unlock(void)
|
||||
{
|
||||
DEBUGVERIFY(nxrmutex_unlock(&get_current_mm()->mm_map_mutex));
|
||||
FAR struct tcb_s *tcb = nxsched_self();
|
||||
FAR struct task_group_s *group = tcb->group;
|
||||
|
||||
if (group == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUGVERIFY(nxrmutex_unlock(&group->tg_mm_map.mm_map_mutex));
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
Loading…
Reference in a new issue