Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc833def authored by Vegard Nossum's avatar Vegard Nossum Committed by David S. Miller
Browse files

net/irda: remove pointless assignment/check



We've already set sk to sock->sk and dereferenced it, so if it's NULL
we would have crashed already. Moreover, if it was NULL we would have
crashed anyway when jumping to 'out' and trying to unlock the sock.
Furthermore, if we had assigned a different value to 'sk' we would
have been calling lock_sock() and release_sock() on different sockets.

My conclusion is that these two lines are complete nonsense and only
serve to confuse the reader.

Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05fafbfb
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -845,9 +845,6 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags)
	if (sock->state != SS_UNCONNECTED)
	if (sock->state != SS_UNCONNECTED)
		goto out;
		goto out;


	if ((sk = sock->sk) == NULL)
		goto out;

	err = -EOPNOTSUPP;
	err = -EOPNOTSUPP;
	if ((sk->sk_type != SOCK_STREAM) && (sk->sk_type != SOCK_SEQPACKET) &&
	if ((sk->sk_type != SOCK_STREAM) && (sk->sk_type != SOCK_SEQPACKET) &&
	    (sk->sk_type != SOCK_DGRAM))
	    (sk->sk_type != SOCK_DGRAM))