diff options
Diffstat (limited to 'fs/smbfs')
-rw-r--r-- | fs/smbfs/sock.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/smbfs/sock.c b/fs/smbfs/sock.c index e48bd8235a8e..e37fe4deebd0 100644 --- a/fs/smbfs/sock.c +++ b/fs/smbfs/sock.c | |||
@@ -329,9 +329,8 @@ smb_receive(struct smb_sb_info *server, struct smb_request *req) | |||
329 | msg.msg_control = NULL; | 329 | msg.msg_control = NULL; |
330 | 330 | ||
331 | /* Dont repeat bytes and count available bufferspace */ | 331 | /* Dont repeat bytes and count available bufferspace */ |
332 | rlen = smb_move_iov(&p, &num, iov, req->rq_bytes_recvd); | 332 | rlen = min_t(int, smb_move_iov(&p, &num, iov, req->rq_bytes_recvd), |
333 | if (req->rq_rlen < rlen) | 333 | (req->rq_rlen - req->rq_bytes_recvd)); |
334 | rlen = req->rq_rlen; | ||
335 | 334 | ||
336 | result = kernel_recvmsg(sock, &msg, p, num, rlen, flags); | 335 | result = kernel_recvmsg(sock, &msg, p, num, rlen, flags); |
337 | 336 | ||