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
@ -286,7 +286,11 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
|
|||||||
|
|
||||||
ret = file_mmap_(filep, start, length,
|
ret = file_mmap_(filep, start, length,
|
||||||
prot, flags, offset, MAP_USER, &mapped);
|
prot, flags, offset, MAP_USER, &mapped);
|
||||||
|
if (filep)
|
||||||
|
{
|
||||||
fs_putfilep(filep);
|
fs_putfilep(filep);
|
||||||
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto errout;
|
goto errout;
|
||||||
|
Loading…
Reference in New Issue
Block a user