Skip to content

Commit 198dd93

Browse files
Zhangshoukuixiaoxiang781216
authored andcommitted
shmfs: return EINVAL if group null
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
1 parent 646bf48 commit 198dd93

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

fs/shm/shmfs.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,11 +387,19 @@ static int shmfs_unmap_area(FAR struct task_group_s *group,
387387
/* Unmap the memory from user virtual address space */
388388

389389
ret = up_shmdt((uintptr_t)vaddr, npages);
390+
if (ret < 0)
391+
{
392+
return ret;
393+
}
390394

391-
/* Add the virtual memory back to the shared memory pool */
395+
/* Free the virtual address space */
392396

393397
vm_release_region(get_group_mm(group), vaddr, length);
394398
}
399+
else
400+
{
401+
return -EINVAL;
402+
}
395403
#endif
396404

397405
return ret;

0 commit comments

Comments
 (0)