Skip to content

Commit 3b8401f

Browse files
wangweidongdavem330
authored andcommitted
tipc: kill unnecessary goto's
Remove a number of needless 'goto exit' in send_stream when the socket is in an unconnected state. This patch is cosmetic and does not alter the operation of TIPC in any way. Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0cee6bb commit 3b8401f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

net/tipc/socket.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -751,16 +751,14 @@ static int send_stream(struct kiocb *iocb, struct socket *sock,
751751

752752
/* Handle special cases where there is no connection */
753753
if (unlikely(sock->state != SS_CONNECTED)) {
754-
if (sock->state == SS_UNCONNECTED) {
754+
res = -ENOTCONN;
755+
756+
if (sock->state == SS_UNCONNECTED)
755757
res = send_packet(NULL, sock, m, total_len);
756-
goto exit;
757-
} else if (sock->state == SS_DISCONNECTING) {
758+
else if (sock->state == SS_DISCONNECTING)
758759
res = -EPIPE;
759-
goto exit;
760-
} else {
761-
res = -ENOTCONN;
762-
goto exit;
763-
}
760+
761+
goto exit;
764762
}
765763

766764
if (unlikely(m->msg_name)) {

0 commit comments

Comments
 (0)