Skip to content

Commit

Permalink
shmfs: return EINVAL if group null
Browse files Browse the repository at this point in the history
Signed-off-by: zhangshoukui <[email protected]>
  • Loading branch information
Zhangshoukui committed Oct 28, 2024
1 parent bf25dd7 commit 180f5fa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion fs/shm/shmfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,19 @@ static int shmfs_unmap_area(FAR struct task_group_s *group,
/* Unmap the memory from user virtual address space */

ret = up_shmdt((uintptr_t)vaddr, npages);
if (ret < 0)
{
return ret;
}

/* Add the virtual memory back to the shared memory pool */
/* Free the virtual address space */

vm_release_region(get_group_mm(group), vaddr, length);
}
else
{
return -EINVAL;
}
#endif

return ret;
Expand Down

0 comments on commit 180f5fa

Please sign in to comment.