diff options
-rw-r--r-- | drivers/pci/pci-driver.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 194f1d21d3d7..84ec9c8f6703 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -445,9 +445,12 @@ int __pci_register_driver(struct pci_driver *drv, struct module *owner) | |||
445 | 445 | ||
446 | /* register with core */ | 446 | /* register with core */ |
447 | error = driver_register(&drv->driver); | 447 | error = driver_register(&drv->driver); |
448 | if (error) | ||
449 | return error; | ||
448 | 450 | ||
449 | if (!error) | 451 | error = pci_create_newid_file(drv); |
450 | error = pci_create_newid_file(drv); | 452 | if (error) |
453 | driver_unregister(&drv->driver); | ||
451 | 454 | ||
452 | return error; | 455 | return error; |
453 | } | 456 | } |