===========================================================================
The problem is that the input parameter is a wrong value, resulting in
an overflow of the 'endbyte', also it will not cause any serious problem
and return out in the next step.
This patch only fix the warning and no change the logic.
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
fs/sync.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
@@ -293,10 +293,11 @@ static int do_fsync(unsigned int fd, int datasync)
if (flags & ~VALID_FLAGS)
goto out;
- endbyte = offset + nbytes;
-
if ((s64)offset < 0)
goto out;
+
+ endbyte = offset + nbytes;
+
if ((s64)endbyte < 0)
goto out;
if (endbyte < offset)