Skip to content

Commit

Permalink
fs: compat: remove redundant check of nr_segs
Browse files Browse the repository at this point in the history
nr_segs should never be less than zero as its type
is unsigned long, so let's remove this check.

Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
shawn1221 authored and Al Viro committed Sep 27, 2016
1 parent a818101 commit 85e7340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ ssize_t compat_rw_copy_check_uvector(int type,
goto out;

ret = -EINVAL;
if (nr_segs > UIO_MAXIOV || nr_segs < 0)
if (nr_segs > UIO_MAXIOV)
goto out;
if (nr_segs > fast_segs) {
ret = -ENOMEM;
Expand Down

0 comments on commit 85e7340

Please sign in to comment.