Commit 97f8b87e authored by Ying Xue's avatar Ying Xue Committed by Paul Gortmaker

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: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent aba79f33
...@@ -503,8 +503,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock, ...@@ -503,8 +503,7 @@ static int send_msg(struct kiocb *iocb, struct socket *sock,
if (unlikely((m->msg_namelen < sizeof(*dest)) || if (unlikely((m->msg_namelen < sizeof(*dest)) ||
(dest->family != AF_TIPC))) (dest->family != AF_TIPC)))
return -EINVAL; return -EINVAL;
if ((total_len > TIPC_MAX_USER_MSG_SIZE) || if (total_len > TIPC_MAX_USER_MSG_SIZE)
(m->msg_iovlen > (unsigned int)INT_MAX))
return -EMSGSIZE; return -EMSGSIZE;
if (iocb) if (iocb)
...@@ -612,8 +611,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock, ...@@ -612,8 +611,7 @@ static int send_packet(struct kiocb *iocb, struct socket *sock,
if (unlikely(dest)) if (unlikely(dest))
return send_msg(iocb, sock, m, total_len); return send_msg(iocb, sock, m, total_len);
if ((total_len > TIPC_MAX_USER_MSG_SIZE) || if (total_len > TIPC_MAX_USER_MSG_SIZE)
(m->msg_iovlen > (unsigned int)INT_MAX))
return -EMSGSIZE; return -EMSGSIZE;
if (iocb) if (iocb)
...@@ -698,8 +696,7 @@ static int send_stream(struct kiocb *iocb, struct socket *sock, ...@@ -698,8 +696,7 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
goto exit; goto exit;
} }
if ((total_len > (unsigned int)INT_MAX) || if (total_len > (unsigned int)INT_MAX) {
(m->msg_iovlen > (unsigned int)INT_MAX)) {
res = -EMSGSIZE; res = -EMSGSIZE;
goto exit; goto exit;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment