The return value of `lseek(fd, fpos, SEEK_SET)` can overflow the `int` type. Fix this.
Fixes: 376fb2dbe66d ("erofs-utils: lib: introduce diskbuf") Signed-off-by: Gao Xiang <hsiang...@linux.alibaba.com> --- lib/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/inode.c b/lib/inode.c index 4c29aa7..ba0419f 100644 --- a/lib/inode.c +++ b/lib/inode.c @@ -497,8 +497,7 @@ int erofs_write_file(struct erofs_inode *inode, int fd, u64 fpos) if (!ret || ret != -ENOSPC) return ret; - ret = lseek(fd, fpos, SEEK_SET); - if (ret < 0) + if (lseek(fd, fpos, SEEK_SET) < 0) return -errno; } -- 2.39.3