All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] sctp: fix error return code in __sctp_connect()
@ 2013-04-03 13:02 ` Wei Yongjun
  0 siblings, 0 replies; 20+ messages in thread
From: Wei Yongjun @ 2013-04-03 13:02 UTC (permalink / raw)
  To: vyasevich, sri, nhorman, davem; +Cc: yongjun_wei, linux-sctp, netdev

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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 <yongjun_wei@trendmicro.com.cn>
---
 net/sctp/socket.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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).


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2016-06-15  6:46 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03 13:02 [PATCH -next] sctp: fix error return code in __sctp_connect() Wei Yongjun
2013-04-03 13:02 ` Wei Yongjun
2013-04-03 13:51 ` Neil Horman
2013-04-03 13:51   ` Neil Horman
2013-04-03 14:52   ` Vlad Yasevich
2013-04-03 14:52     ` Vlad Yasevich
2013-04-03 14:59     ` Neil Horman
2013-04-03 14:59       ` Neil Horman
2013-04-03 14:52 ` Vlad Yasevich
2013-04-03 14:52   ` Vlad Yasevich
2013-04-07 21:04 ` David Miller
2013-04-07 21:04   ` David Miller
2016-06-13 15:08 ` [PATCH -next] sctp: fix error return code in sctp_init() weiyj_lk
2016-06-13 15:08   ` weiyj_lk
2016-06-14  3:04   ` Xin Long
2016-06-14  3:04     ` Xin Long
2016-06-14 13:21     ` Neil Horman
2016-06-14 13:21       ` Neil Horman
2016-06-15  6:46   ` David Miller
2016-06-15  6:46     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.