summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLong Li <longli@microsoft.com>2018-04-17 12:17:05 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-26 11:00:35 +0200
commit8d931c6adf5def75d1bc36ec1e17458b1d3045e9 (patch)
tree6a888b0d67fa6441045cf16d1f25dba0cd97ae56
parentb42b71cd28f213cf4688b9891e66b57bdb6eefe8 (diff)
cifs: smbd: Check for iov length on sending the last iov
commit ab60ee7bf9a84954f50a66a3d835860e80f99b7f upstream. When sending the last iov that breaks into smaller buffers to fit the transfer size, it's necessary to check if this is the last iov. If this is the latest iov, stop and proceed to send pages. Signed-off-by: Long Li <longli@microsoft.com> Cc: stable@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/cifs/smbdirect.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c
index 52cccdbb7e14..34be5c5d027f 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -2194,6 +2194,8 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst)
goto done;
}
i++;
+ if (i == rqst->rq_nvec)
+ break;
}
start = i;
buflen = 0;