Re: [linux-usb-devel] Re: [OOPS] reproducible oops with 2.6.5-rc2-bk3

From: Alan Stern
Date: Thu Mar 25 2004 - 12:03:55 EST


On Thu, 25 Mar 2004, Colin Leroy wrote:

> Additionally, there's still a reference to altsetting[0] in cdc-acm.c (in
> acm_ctrl_msg()), I don't know if it's intentional or should have been
> converted from
> acm->control->altsetting[0].desc.bInterfaceNumber
> to
> acm->control->cur_altsetting.desc.bInterfaceNumber
> ?

It's not as bad as it looks. All the altsetting entries for an interface
are guaranteed to have the same value stored in desc.bInterfaceNumber, so
it really doesn't matter whether that value is retrieved from the first
entry in the altsetting array or the current entry -- provided of course
that cur_altsetting is a valid pointer! It's mostly just a matter of
taste. I generally prefer to use cur_altsetting because that's the one
currently installed in the device.

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/