procfs/cpuinfo: Zero copylen in cpuinfo_read

to avoid return the negative number

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-12-10 10:56:12 +08:00 committed by Petro Karashchenko
parent 449197c188
commit 19baa56fb5
1 changed files with 4 additions and 0 deletions

View File

@ -157,6 +157,10 @@ static ssize_t cpuinfo_read(FAR struct file *filep, FAR char *buffer,
{ {
filep->f_pos += copylen; filep->f_pos += copylen;
} }
else
{
copylen = 0;
}
return copylen; return copylen;
} }