Skip to content

Commit

Permalink
misc: mei: unregister misc device in pci_remove function
Browse files Browse the repository at this point in the history
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: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tomas Winkler authored and Greg Kroah-Hartman committed Jun 13, 2012
1 parent aa189ec commit a44cab4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/misc/mei/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,8 @@ static void __devexit mei_remove(struct pci_dev *pdev)

pci_release_regions(pdev);
pci_disable_device(pdev);

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

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

0 comments on commit a44cab4

Please sign in to comment.