From: Linus Torvalds Date: Sun, 2 Nov 2014 18:20:26 +0000 (-0800) Subject: irda: stop calling sk_prot->disconnect() on connection failure X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4cb8c3593bbb884c5c282b1d8502a0930235fe88;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Cc: Samuel Ortiz Cc: David Miller Signed-off-by: Linus Torvalds --- diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 92fafd485deb..3f3a6cbdceb7 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -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;