mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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: Vegard Nossum <vegard.nossum@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
05fafbfb3d
commit
dc833def42
1 changed files with 0 additions and 3 deletions
|
@ -845,9 +845,6 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags)
|
|||
if (sock->state != SS_UNCONNECTED)
|
||||
goto out;
|
||||
|
||||
if ((sk = sock->sk) == NULL)
|
||||
goto out;
|
||||
|
||||
err = -EOPNOTSUPP;
|
||||
if ((sk->sk_type != SOCK_STREAM) && (sk->sk_type != SOCK_SEQPACKET) &&
|
||||
(sk->sk_type != SOCK_DGRAM))
|
||||
|
|
Loading…
Add table
Reference in a new issue