From 08591ccfdd4f237b3d931e0ebf05690b1ab91399 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Wed, 26 May 2021 15:32:26 +0900 Subject: [PATCH] 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 Signed-off-by: Namjae Jeon Signed-off-by: Steve French --- fs/cifsd/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- GitLab