diff --git a/fs/generic.c b/fs/generic.c index 7b2326aefa..f653fc0818 100644 --- a/fs/generic.c +++ b/fs/generic.c @@ -293,7 +293,7 @@ int generic_seek(struct fd *fd, off_t_ off, int whence, size_t size) { if (whence == LSEEK_SET) { fd->offset = off; } else if (whence == LSEEK_CUR) { - if (!__builtin_add_overflow(new_off, off, &new_off) || new_off < 0) + if (__builtin_add_overflow(new_off, off, &new_off) || new_off < 0) return _EINVAL; fd->offset = new_off; } else if (whence == LSEEK_END) {