Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a44cab4a authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman
Browse files

misc: mei: unregister misc device in pci_remove function



Since the misc device is registered only in the pci probe function
it has to be also unregistered in the counterpart pci remove function
and not in the module exit function.
In case of probe failure the driver was oopsing in module exit function.

Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aa189ecd
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1101,6 +1101,8 @@ static void __devexit mei_remove(struct pci_dev *pdev)


	pci_release_regions(pdev);
	pci_release_regions(pdev);
	pci_disable_device(pdev);
	pci_disable_device(pdev);

	misc_deregister(&mei_misc_device);
}
}
#ifdef CONFIG_PM
#ifdef CONFIG_PM
static int mei_pci_suspend(struct device *device)
static int mei_pci_suspend(struct device *device)
@@ -1216,7 +1218,6 @@ module_init(mei_init_module);
 */
 */
static void __exit mei_exit_module(void)
static void __exit mei_exit_module(void)
{
{
	misc_deregister(&mei_misc_device);
	pci_unregister_driver(&mei_driver);
	pci_unregister_driver(&mei_driver);


	pr_debug("unloaded successfully.\n");
	pr_debug("unloaded successfully.\n");