9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Gorka Guardiola <paurea@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] usb serial bug
Date: Thu, 14 Feb 2013 20:54:00 +0100	[thread overview]
Message-ID: <E593EC29-45DF-4AB3-B8E8-984938952567@gmail.com> (raw)
In-Reply-To: <25f8de8836cc6c592e70cd662b61d0a2@hamnavoe.com>

Yes, I am looking into it and just saw this.
G.

On Feb 14, 2013, at 8:24 PM, Richard Miller <9fans@hamnavoe.com> wrote:

> I said:
>
>>> The current Plan 9 usb architecture perpetuates the confusion by
>>> referring to them both with one name epN.1, but you still have to open
>>> them both independently.
>
> Erik replied:
>> in that case, shouldn't these three blocks be reverted?
>
> Erik is right, I was talking through my hat.  It's OK to open bulk
> endpoints read/write, and the kernel will do the right thing.  The
> actual problem, which neither of us had spotted although it was
> staring us in the face, is this:
>
>            if((ep->dir == Ein || ep->dir == Eboth) && epin == -1)
>                epin = ep->id;
>            if((ep->dir == Ein || ep->dir == Eboth) && epout == -1)
>                epout = ep->id;
>
> Notice the two occurrences of Ein?  The second one obviously should
> be Eout.  It was a typo (mine, I blush to admit).
>
> My usb serial adapter uses the same ep number for input and output,
> so my testing didn't reveal this error.  I think the same typo will
> account for the double-free bug which Jeff (and Lucio on 4 Feb) reported.
>
> Erik, Jeff, Lucio - please try changing the offending Ein to Eout in
> /sys/src/cmd/usb/serial/serial.c:721 and see if your troubles are resolved.
>
>



  reply	other threads:[~2013-02-14 19:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14  3:46 erik quanstrom
2013-02-14 10:23 ` Richard Miller
2013-02-14 14:33   ` erik quanstrom
2013-02-14 15:21     ` Jeff Sickel
2013-02-14 19:24     ` Richard Miller
2013-02-14 19:54       ` Gorka Guardiola [this message]
2013-02-14 20:16         ` Gorka Guardiola
2013-02-14 20:44           ` Richard Miller

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=E593EC29-45DF-4AB3-B8E8-984938952567@gmail.com \
    --to=paurea@gmail.com \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).