public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: torvalds@linux-foundation.org
Cc: samuel@sortiz.org, netdev@vger.kernel.org
Subject: Re: IrDA woes..
Date: Thu, 02 Jan 2014 03:46:53 -0500 (EST)	[thread overview]
Message-ID: <20140102.034653.1968429090467668489.davem@davemloft.net> (raw)
In-Reply-To: <CA+55aFz2CQ4B1JSpQ75TuQrrd9sUnhV+u=T2dWZY2NTTT5OmpQ@mail.gmail.com>

From: Linus Torvalds <torvalds@linux-foundation.org>
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.

  reply	other threads:[~2014-01-02  8:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-31 20:08 IrDA woes Linus Torvalds
2014-01-02  8:46 ` David Miller [this message]
2014-01-02 19:11   ` Linus Torvalds
2014-01-02 21:07     ` Linus Torvalds
2014-01-02 22:41       ` David Miller
2014-01-02 22:47         ` Linus Torvalds
2014-01-03  0:05           ` David Miller
2014-01-03  1:00             ` Linus Torvalds
2014-01-02 21:41     ` Marcel Holtmann
2014-01-02 21:49       ` Linus Torvalds
2014-01-02 22:13         ` Marcel Holtmann
2014-01-02 22:29           ` Linus Torvalds
2014-01-02 22:54             ` Linus Torvalds
2014-01-02 22:42     ` David Miller
2014-01-04  1:23     ` Samuel Ortiz
2014-01-04  8:15       ` Loganaden Velvindron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140102.034653.1968429090467668489.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=samuel@sortiz.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox