On Fri, 3 Sep 2004, Alex Kanavin wrote:

> On Fri, 3 Sep 2004, Oliver Neukum wrote:
> 
> > +       udev = to_usb_device (dev);                                     \
> > +       if (!udev->actconfig)                                           \
> > +               return 0;                                               \
> > +       len = usb_string(udev, udev->actconfig->desc.field, buf, PAGE_SIZE);\
> > 
> > What will happen if you run this while the configuration is changed?
> 
> I don't know :) But there's a similar code just above that exports 
> configuration parameters, so I think it should be okay:

In both places the code needs to do something like this:

        struct usb_host_config *actconfig = udev->actconfig;

        if (!actconfig)
                return 0;
        len = usb_string(udev, actconfig->desc.field,...

Otherwise we run the risk that udev->actconfig could change from a 
non-NULL value to NULL immediately after the test but before the 
dereference.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to