From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: IrDA woes.. Date: Thu, 02 Jan 2014 03:46:53 -0500 (EST) Message-ID: <20140102.034653.1968429090467668489.davem@davemloft.net> References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: samuel@sortiz.org, netdev@vger.kernel.org To: torvalds@linux-foundation.org Return-path: Received: from shards.monkeyblade.net ([149.20.54.216]:47719 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249AbaABIqz (ORCPT ); Thu, 2 Jan 2014 03:46:55 -0500 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: From: Linus Torvalds Date: Tue, 31 Dec 2013 12:08:43 -0800 > One of the oopses seems simple: irda_attach() will do I assume you mean irda_connect(). > if (sk->sk_prot->disconnect(sk, flags)) > sock->state = SS_DISCONNECTING; > > if the connection fails. But sk_prot->disconnect is NULL for IrDA, so > that will just oops. Apparently real devices don't end up ever > triggering that, but I don't think it can ever have worked. That sk_prot should be irda_proto, which doesn't provide any non-NULL operations ?!?! That snippet was probably cut and pasted from another protocol's create implementation. Generic code (such as that in net/core/sock.c) checks if the various sk_prot methods are NULL before trying to invoke them. I think the thing to do for now is to simply remove those two lines. I don't believe that anyone has looked closely at this code for a long time except with automated tools like semantic checkers.