mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, alan@linux.intel.com,
	devel@linuxdriverproject.org,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH 3/4] misc: mei: unregister misc device in pci_remove function
Date: Tue, 29 May 2012 16:39:11 +0300	[thread overview]
Message-ID: <1338298752-15445-4-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1338298752-15445-1-git-send-email-tomas.winkler@intel.com>

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>
---
 drivers/misc/mei/main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index 88e5953..a5a17e7 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -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)
@@ -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");
-- 
1.7.4.4


  parent reply	other threads:[~2012-05-29 13:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-29 13:39 misc: mei: fixes for 3.5 Tomas Winkler
2012-05-29 13:39 ` [PATCH 1/4 V2] mei: mei.txt: minor grammar fixes Tomas Winkler
2012-05-29 13:39 ` [PATCH 2/4] misc: mei: set IRQF_ONESHOT for msi request_threaded_irq Tomas Winkler
2012-05-29 13:39 ` Tomas Winkler [this message]
2012-05-29 13:39 ` [PATCH 4/4] misc: mei: fix stalled read Tomas Winkler
2012-06-13 20:37 ` misc: mei: fixes for 3.5 Greg KH
2012-06-13 21:09   ` Winkler, Tomas
2012-06-13 21:45     ` Greg KH
2012-06-13 22:34       ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338298752-15445-4-git-send-email-tomas.winkler@intel.com \
    --to=tomas.winkler@intel.com \
    --cc=alan@linux.intel.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®