fs_msync:Fix crash caused under the anonymous mapping
Summary: Limitations of using fs putfile Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
parent
d04205aa3d
commit
c9148fbb0a
1 changed files with 5 additions and 1 deletions
|
|
@ -286,7 +286,11 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
|
|||
|
||||
ret = file_mmap_(filep, start, length,
|
||||
prot, flags, offset, MAP_USER, &mapped);
|
||||
fs_putfilep(filep);
|
||||
if (filep)
|
||||
{
|
||||
fs_putfilep(filep);
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
goto errout;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue