Skip to content

Commit

Permalink
irda: stop calling sk_prot->disconnect() on connection failure
Browse files Browse the repository at this point in the history
The sk_prot is irda's own set of protocol handlers, so irda should
statically know what that function is anyway, without using an indirect
pointer.  And as it happens, we know *exactly* what that pointer is
statically: it's NULL, because irda doesn't define a disconnect
operation.

So calling that function is doubly wrong, and will just cause an oops.

Reported-by: Martin Lang <mlg.hessigheim@gmail.com>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Nov 2, 2014
1 parent 12d7aac commit 4cb8c35
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions net/irda/af_irda.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,6 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr,

if (sk->sk_state != TCP_ESTABLISHED) {
sock->state = SS_UNCONNECTED;
if (sk->sk_prot->disconnect(sk, flags))
sock->state = SS_DISCONNECTING;
err = sock_error(sk);
if (!err)
err = -ECONNRESET;
Expand Down

0 comments on commit 4cb8c35

Please sign in to comment.