From: Wei Yongjun Date: Wed, 3 Apr 2013 03:02:28 +0000 (+0000) Subject: sctp: fix error return code in __sctp_connect() X-Git-Tag: v3.10-rc1~66^2~221 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=524fba6c14d2892bfa27c01577d544d6380291ba;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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: Wei Yongjun Acked-by: Vlad Yasevich Acked-by: Neil Horman Signed-off-by: David S. Miller --- diff --git a/net/sctp/socket.c b/net/sctp/socket.c index dd21ae3..f631c5f 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -1119,9 +1119,10 @@ static int __sctp_connect(struct sock* sk, /* Make sure the destination port is correctly set * 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; - + } /* Check if there already is a matching association on the * endpoint (other than the one created here).