From 19baa56fb53bb3de12e0a022d74a32b8bc8de6b7 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 10 Dec 2023 10:56:12 +0800 Subject: [PATCH] procfs/cpuinfo: Zero copylen in cpuinfo_read to avoid return the negative number Signed-off-by: Xiang Xiao --- fs/procfs/fs_procfscpuinfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/procfs/fs_procfscpuinfo.c b/fs/procfs/fs_procfscpuinfo.c index 73f7ffb40d..c818dd6284 100644 --- a/fs/procfs/fs_procfscpuinfo.c +++ b/fs/procfs/fs_procfscpuinfo.c @@ -157,6 +157,10 @@ static ssize_t cpuinfo_read(FAR struct file *filep, FAR char *buffer, { filep->f_pos += copylen; } + else + { + copylen = 0; + } return copylen; }