pci: unset driver if probe fails

dev->driver should be set only if a driver did take the device.

Signed-off-by: David Marchand <david.marchand@6wind.com>
This commit is contained in:
David Marchand 2016-11-07 10:03:29 +01:00 committed by Thomas Monjalon
parent 07b156199f
commit d82eeefe7a

View File

@ -214,7 +214,11 @@ rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *d
dev->driver = dr;
/* call the driver probe() function */
return dr->probe(dr, dev);
ret = dr->probe(dr, dev);
if (ret)
dev->driver = NULL;
return ret;
}
/* return positive value if driver doesn't support this device */
return 1;