Re: [Suggestion] drivers/usb/core: dev-config and dev->rawdescriptors, when processing failure.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 7 Dec 2012, Chen Gang wrote:

>   but I still not quite be sure, please help checking (total 3 steps, below).
> 
>   thanks.
> 
> ------------------------------------------------------------------------------
> Step 1:
> 
> in drivers/usb/core/sysfs.c:
> 
>   for the same device, can usb_dev_authorized_store be called multi-times ?
>     according to the function comments, it seems can be called multi-times.

Yes, it can.

> Step 2:
> 
> in drivers/usb/core/hub.c:
> 
>    usb_authorize_device may call usb_enumerate_device at line 2355

Yes.

> Step 3:
> 
> also in drivers/usb/core/hub.c:
> 
>   if udev->config != NULL:
>     we will assume that it has already configured,
>     and will not call usb_get_configuration again.
> 
>   if first call for usb_get_confiuration failed, may udev->config will not be NULL.
>   and next call usb_enumerate_device, 
>     we will misunderstand that it has already configured (all things are 0).

If the first call to usb_get_configuration fails, there won't be any 
more calls to usb_enumerate_device.  The device will be rejected by 
usb_new_device.

Alan Stern

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux