diff options
author | Ying Xue <ying.xue@windriver.com> | 2013-01-31 15:51:47 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2013-02-15 17:03:32 -0500 |
commit | 97f8b87e9108485a0b7070645662253561304458 (patch) | |
tree | bd50c70ebf1715be2947087cd8ca341b06bbdbce /net/tipc | |
parent | aba79f332f46ca8529f3e62a9fc2926c8fe75e44 (diff) |
tipc: remove redundant checking for the number of iovecs in a send request
As the number of iovecs in a send request is already limited within
UIO_MAXIOV(i.e. 1024) in __sys_sendmsg(), it's unnecessary to check it
again in TIPC stack.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/socket.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index cbe2f6ecf07a..a9622b6cd916 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -503,8 +503,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock, | |||
503 | if (unlikely((m->msg_namelen < sizeof(*dest)) || | 503 | if (unlikely((m->msg_namelen < sizeof(*dest)) || |
504 | (dest->family != AF_TIPC))) | 504 | (dest->family != AF_TIPC))) |
505 | return -EINVAL; | 505 | return -EINVAL; |
506 | if ((total_len > TIPC_MAX_USER_MSG_SIZE) || | 506 | if (total_len > TIPC_MAX_USER_MSG_SIZE) |
507 | (m->msg_iovlen > (unsigned int)INT_MAX)) | ||
508 | return -EMSGSIZE; | 507 | return -EMSGSIZE; |
509 | 508 | ||
510 | if (iocb) | 509 | if (iocb) |
@@ -612,8 +611,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, | |||
612 | if (unlikely(dest)) | 611 | if (unlikely(dest)) |
613 | return send_msg(iocb, sock, m, total_len); | 612 | return send_msg(iocb, sock, m, total_len); |
614 | 613 | ||
615 | if ((total_len > TIPC_MAX_USER_MSG_SIZE) || | 614 | if (total_len > TIPC_MAX_USER_MSG_SIZE) |
616 | (m->msg_iovlen > (unsigned int)INT_MAX)) | ||
617 | return -EMSGSIZE; | 615 | return -EMSGSIZE; |
618 | 616 | ||
619 | if (iocb) | 617 | if (iocb) |
@@ -698,8 +696,7 @@ static int send_stream(struct kiocb *iocb, struct socket *sock, | |||
698 | goto exit; | 696 | goto exit; |
699 | } | 697 | } |
700 | 698 | ||
701 | if ((total_len > (unsigned int)INT_MAX) || | 699 | if (total_len > (unsigned int)INT_MAX) { |
702 | (m->msg_iovlen > (unsigned int)INT_MAX)) { | ||
703 | res = -EMSGSIZE; | 700 | res = -EMSGSIZE; |
704 | goto exit; | 701 | goto exit; |
705 | } | 702 | } |