Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

irda: stop calling sk_prot->disconnect() on connection failure

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>

-2
-2
net/irda/af_irda.c
··· 1064 1064 1065 1065 if (sk->sk_state != TCP_ESTABLISHED) { 1066 1066 sock->state = SS_UNCONNECTED; 1067 - if (sk->sk_prot->disconnect(sk, flags)) 1068 - sock->state = SS_DISCONNECTING; 1069 1067 err = sock_error(sk); 1070 1068 if (!err) 1071 1069 err = -ECONNRESET;