Re: [PATCH v4] USB: Fix device driver race

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

 



On Fri, Jul 24, 2020 at 06:52:31PM +0200, Bastien Nocera wrote:
> On Fri, 2020-07-24 at 11:27 -0400, Alan Stern wrote:

> > > > +               if (new_udriver->match || new_udriver->id_table)
> > > 
> > > But match check is incorporated in the loop function.
> > 
> > Agreed, this test is redundant.  However, we should test that 
> > new_udriver != &usb_generic_driver.
> 
> Do you really want to loop over every USB device when you know for a
> fact that not a single one will match?

Think of it the other way around: How often will anybody load a 
specialized USB device driver that doesn't have a match function or ID 
table?  It wouldn't match any devices!

> I guess it's unlikely, the generic driver would be loaded before any
> device,

Since it's built into usbcore, I guess that's true.

>  and the specialised drivers need to be able to selected, so
> I've done that locally.

Okay, you're ready to submit the next version?

Alan Stern



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

  Powered by Linux