diff options
author | 2021-05-26 15:32:26 +0900 | |
---|---|---|
committer | 2021-05-26 18:12:37 +0900 | |
commit | 08591ccfdd4f237b3d931e0ebf05690b1ab91399 (patch) | |
tree | 652c1bace1cf8c2be4de71d58e7f2947f2d96f7e | |
parent | cifsd: add the check if nvec is zero (diff) | |
download | wireguard-linux-08591ccfdd4f237b3d931e0ebf05690b1ab91399.tar.xz wireguard-linux-08591ccfdd4f237b3d931e0ebf05690b1ab91399.zip |
cifsd: len can never be negative in ksmbd_init_sg()
Dan pointed out len can not be negative.
This patch remove unneeded negative check in loop.
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r-- | fs/cifsd/auth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifsd/auth.c b/fs/cifsd/auth.c index 9f957c8c123c..9af1b334be82 100644 --- a/fs/cifsd/auth.c +++ b/fs/cifsd/auth.c @@ -1207,7 +1207,7 @@ static struct scatterlist *ksmbd_init_sg(struct kvec *iov, unsigned int nvec, for (j = 0; j < nr_entries[i]; j++) { unsigned int bytes = PAGE_SIZE - offset; - if (len <= 0) + if (!len) break; if (bytes > len) |