Blatant simple bug in Cavium SDK USB code?

bhanuprakash bodireddy bhanuprakashbodireddy at gmail.com
Fri Apr 1 18:57:04 UTC 2011


Hi Andrew,

That was definitely a good catch.
Thanks for pointing that, Also if you have any other issues with USB code
 in contrib/octeon-sdk/*, please do let us know.

Thanks,
Bhanu Prakash.


On Fri, Apr 1, 2011 at 11:45 AM, Juli Mallett <jmallett at freebsd.org> wrote:

> Hey Andrew,
>
> On Fri, Apr 1, 2011 at 11:08, Andrew Duane <aduane at juniper.net> wrote:
> >
> > In the routine cvmx_usb_initialize in sys/contrib/octeon-sdk/cvmx-usb.c,
> I'm pretty sure there's a silly little bug that really BADLY breaks the USB
> driver for some of us.
> >
> > Near the top, after it finds board type and sets the clock type, as part
> of the structure initialization, there is:
> >
> >    memset(usb, 0, sizeof(usb));
> >
> > Tell me that is not supposed to be:
> >
> >    memset(usb, 0, sizeof(*usb));
> >
> > The existing code only zeros 4/8 bytes, instead of the 23KB of the
> structure.
>
> Ouch, nice catch.  Is that the only thing keeping the USB driver from
> working for you?  I thought it had rotted some behind other controller
> changes and also had some problems with stalls, but perhaps the
> culprit was initialization all along.  I'll check in that fix soon,
> but would like to hear from you as to whether you have any additional
> fixes for USB (or even bugs to report.)
>
> I've BCC'd some Cavium people who will no doubt appreciate the bug report!
>
> Thanks,
> Juli.
>


More information about the freebsd-mips mailing list