diff options
-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 | } |