PCI: Check dynids driver_data value for validity

Only accept dynids whose driver_data value matches one of the driver's
pci_driver_id entries. This prevents the user from accidentally passing
values the drivers do not expect.

Cc: Milton Miller <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Jean Delvare <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
This commit is contained in:
Jean Delvare 2008-08-17 21:06:59 +02:00 • committed by Jesse Barnes
commit b41d6cf38e
4 changed files with 20 additions and 10 deletions

View file

@ -163,6 +163,10 @@ need pass only as many optional fields as necessary:
o class and classmask fields default to 0
o driver_data defaults to 0UL.
Note that driver_data must match the value used by any of the pci_device_id
entries defined in the driver. This makes the driver_data field mandatory
if all the pci_device_id entries have a non-zero driver_data value.
Once added, the driver probe routine will be invoked for any unclaimed
PCI devices listed in its (newly updated) pci_ids list.