fs/romfs: fix open zero-byte file fail issue

N/A

Error log as below:
romfs_open: ERROR: Failed to locate start of file data: -5

Change-Id: I0594a84b727077606450dea3ea348cfc2390458b
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
liuhaitao 2021-01-27 16:56:24 +08:00 committed by Xiang Xiao
parent 01fabe6c67
commit dc14f89909

View File

@ -982,7 +982,7 @@ int romfs_datastart(struct romfs_mountpt_s *rm, uint32_t offset,
/* Get the offset to the next chunk */ /* Get the offset to the next chunk */
offset += 16; offset += 16;
if (offset >= rm->rm_volsize) if (offset > rm->rm_volsize)
{ {
return -EIO; return -EIO;
} }