Re: [PATCH -next] sctp: fix error return code in __sctp_connect()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/03/2013 09:02 AM, Wei Yongjun wrote:
From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxx>

Acked-by: Vlad Yasevich <vyasevich@xxxxxxxxx>

-vlad

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


--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux