summaryrefslogtreecommitdiffstats
path: root/net/irda/af_irda.c
diff options
context:
space:
mode:
authorVegard Nossum <vegard.nossum@oracle.com>2016-08-19 18:08:57 +0200
committerDavid S. Miller <davem@davemloft.net>2016-08-19 18:07:24 -0700
commitdc833def42e7f2425f69d83a53bee054e80caea5 (patch)
tree6d061b425568ebd158e24a176af37e225023f3fc /net/irda/af_irda.c
parent05fafbfb3d77f43ae18341ddc61eb5c477896778 (diff)
downloadlinux-dc833def42e7f2425f69d83a53bee054e80caea5.tar.gz
linux-dc833def42e7f2425f69d83a53bee054e80caea5.tar.bz2
linux-dc833def42e7f2425f69d83a53bee054e80caea5.zip
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>
Diffstat (limited to 'net/irda/af_irda.c')
-rw-r--r--net/irda/af_irda.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c
index 8d2f7c9b491d..db639690c205 100644
--- a/net/irda/af_irda.c
+++ b/net/irda/af_irda.c
@@ -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))