All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Remski <mremski@mutualink.net>
To: Johan Hovold <jhovold@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: ftdi_sio BUG: NULL pointer dereference
Date: Tue, 03 Jun 2014 06:17:33 -0400	[thread overview]
Message-ID: <538DA0BD.5080208@mutualink.net> (raw)
In-Reply-To: <20140602174630.GD13790@localhost>

On 06/02/2014 01:46 PM, Johan Hovold wrote:
> On Mon, Jun 02, 2014 at 01:11:37PM -0400, Mike Remski wrote:
>> On 06/02/2014 12:49 PM, Johan Hovold wrote:
>>> On Mon, Jun 02, 2014 at 12:24:44PM -0400, Mike Remski wrote:
>>>> On 06/02/2014 12:20 PM, Johan Hovold wrote:
>>>>> On Mon, Jun 02, 2014 at 12:02:40PM -0400, Mike Remski wrote:
>>>>>> On 06/02/2014 11:40 AM, Johan Hovold wrote:
>>>>>>> [ Please avoid top-posting. ]
>>>>>>>
>>>>>>> On Mon, Jun 02, 2014 at 11:16:11AM -0400, Mike Remski wrote:
>>>>> The third interface lacks endpoints and crashes the ftdi_sio driver.
>>>>> This shouldn't happen (even if you're forcing the wrong driver to bind),
>>>>> so I'll fix it up if still broken in v3.15-rc.
>>>>>
>>>> Johan,
>>>> Thanks again.  Yes, the device does indeed have an FTDI embedded in it;
>>>> they've programmed in their own ids.  They supply a Windows driver for
>>>> it, but that doesn't do me any good.  :)
>>> Not just their own ID's it seems.
>>>
>>> Have you tried just using the cdc-acm driver? The ports should up as
>>> /dev/ttyACMx instead of ttyUSBx.
>>>
>> Not yet, next on the list.
> You really should try this before anything else. :)
>
>> I'm suspecting that bNumEndpoints == 0 is causing endpoint[1].desc to
>> stay at NULL (line 1567 in 3.1.4.5 source), so by the time it gets used
>> later on, I'm hitting the NULL dereference.
> Yeah, the code is obviously broken (also in v3.15-rc). It should
> probably work to just return from ftdi_set_max_packet_size if
> num_endpoints is 0 if you want to try that (or you can use your ?:
> construct), but I should be able to fix this up properly on Wednesday.
>
> Thanks,
> Johan
Johan,
I had a chance to play around with code over in ftdi_sio.c;   adding this:

         if (!num_endpoints) {
                 return;
         }
  after the "Number of endpoints" message gets rid of the crash, 
everything looks to be working correctly.

Thanks again

m

-- 
Office: (978)401-4032 (x123 internally)
Cell: (603) 759-6953


  parent reply	other threads:[~2014-06-03 10:17 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 14:25 ftdi_sio BUG: NULL pointer dereference Mike Remski
2014-06-02 14:33 ` Johan Hovold
2014-06-02 15:16   ` Mike Remski
2014-06-02 15:40     ` Johan Hovold
2014-06-02 16:02       ` Mike Remski
2014-06-02 16:20         ` Johan Hovold
2014-06-02 16:24           ` Mike Remski
2014-06-02 16:49             ` Johan Hovold
2014-06-02 17:11               ` Mike Remski
2014-06-02 17:46                 ` Johan Hovold
2014-06-02 17:50                   ` Mike Remski
2014-06-03 10:17                   ` Mike Remski [this message]
2014-06-04 14:19                     ` Johan Hovold
2014-06-04 14:29                       ` Mike Remski
2014-06-04 14:52                         ` Johan Hovold
2014-06-04 14:54                           ` Mike Remski
2014-06-04 14:55                           ` Mike Remski
2014-06-04 15:09                             ` Johan Hovold
2014-06-04 15:12                               ` Mike Remski
2014-06-04 15:41                               ` Mike Remski
2014-06-04 16:00                                 ` Johan Hovold
2014-06-04 16:13                                   ` Mike Remski
2014-06-04 17:05                                   ` Mike Remski
2014-06-05  7:10                                     ` Johan Hovold
2014-06-02 16:09       ` Mike Remski
2014-06-02 16:23         ` Greg KH
2014-06-02 16:26           ` Mike Remski

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=538DA0BD.5080208@mutualink.net \
    --to=mremski@mutualink.net \
    --cc=jhovold@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.