Commit 524fba6c authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller

sctp: fix error return code in __sctp_connect()

Fix to return a negative error code from the error handling
case instead of 0, as returned elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: default avatarVlad Yasevich <vyasevich@gmail.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cfbe800b
...@@ -1119,9 +1119,10 @@ static int __sctp_connect(struct sock* sk, ...@@ -1119,9 +1119,10 @@ static int __sctp_connect(struct sock* sk,
/* Make sure the destination port is correctly set /* Make sure the destination port is correctly set
* in all addresses. * in all addresses.
*/ */
if (asoc && asoc->peer.port && asoc->peer.port != port) if (asoc && asoc->peer.port && asoc->peer.port != port) {
err = -EINVAL;
goto out_free; goto out_free;
}
/* Check if there already is a matching association on the /* Check if there already is a matching association on the
* endpoint (other than the one created here). * endpoint (other than the one created here).
......
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