fs/rpmsgfs: fix bug about using uninit variable "times"

Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
This commit is contained in:
Jiuzhu Dong 2022-04-01 10:42:28 +08:00 committed by Xiang Xiao
parent 6f210655fa
commit 0a111b7c96
2 changed files with 6 additions and 0 deletions

View File

@ -348,6 +348,7 @@ int host_fchstat(int fd, const struct nuttx_stat_s *buf, int flags)
}
else
{
times[0].tv_sec = 0;
times[0].tv_nsec = UTIME_OMIT;
}
@ -358,6 +359,7 @@ int host_fchstat(int fd, const struct nuttx_stat_s *buf, int flags)
}
else
{
times[1].tv_sec = 0;
times[1].tv_nsec = UTIME_OMIT;
}
@ -634,6 +636,7 @@ int host_chstat(const char *path, const struct nuttx_stat_s *buf, int flags)
}
else
{
times[0].tv_sec = 0;
times[0].tv_nsec = UTIME_OMIT;
}
@ -644,6 +647,7 @@ int host_chstat(const char *path, const struct nuttx_stat_s *buf, int flags)
}
else
{
times[1].tv_sec = 0;
times[1].tv_nsec = UTIME_OMIT;
}

View File

@ -769,6 +769,7 @@ static int rpmsgfs_chstat_handler(FAR struct rpmsg_endpoint *ept,
}
else
{
times[0].tv_sec = 0;
times[0].tv_nsec = UTIME_OMIT;
}
@ -778,6 +779,7 @@ static int rpmsgfs_chstat_handler(FAR struct rpmsg_endpoint *ept,
}
else
{
times[1].tv_sec = 0;
times[1].tv_nsec = UTIME_OMIT;
}