From: Stefan Achatz <erazor_de@users.sourceforge.net>
To: Randy Dunlap <rdunlap@xenotime.net>,
Jiri Kosina <jkosina@suse.cz>,
Stefan Achatz <erazor_de@users.sourceforge.net>,
Mauro Carvalho Chehab <mchehab@redhat.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Greg Kroah-Hartman <gregkh@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Weber <weber@corscience.de>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org
Subject: [PATCH 7/8] HID: roccat: Fixed NULL pointer dereference when unloading module
Date: Sun, 30 Jan 2011 13:38:27 +0100 [thread overview]
Message-ID: <1296391107.2283.186.camel@neuromancer> (raw)
Class was destroyed before starting the unregistering driver chain.
Disconnecting a device from roccat chardev in this process then
raised a NULL pointer dereference.
Fixed this by destroying class after unregistering driver.
Signed-off-by: Stefan Achatz <erazor_de@users.sourceforge.net>
---
drivers/hid/hid-roccat-arvo.c | 2 +-
drivers/hid/hid-roccat-kone.c | 2 +-
drivers/hid/hid-roccat-koneplus.c | 2 +-
drivers/hid/hid-roccat-kovaplus.c | 2 +-
drivers/hid/hid-roccat-pyra.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c
index 7b9a992..75f532f 100644
--- a/drivers/hid/hid-roccat-arvo.c
+++ b/drivers/hid/hid-roccat-arvo.c
@@ -438,8 +438,8 @@ static int __init arvo_init(void)
static void __exit arvo_exit(void)
{
- class_destroy(arvo_class);
hid_unregister_driver(&arvo_driver);
+ class_destroy(arvo_class);
}
module_init(arvo_init);
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c
index 5cdb282..d749796 100644
--- a/drivers/hid/hid-roccat-kone.c
+++ b/drivers/hid/hid-roccat-kone.c
@@ -844,8 +844,8 @@ static int __init kone_init(void)
static void __exit kone_exit(void)
{
- class_destroy(kone_class);
hid_unregister_driver(&kone_driver);
+ class_destroy(kone_class);
}
module_init(kone_init);
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c
index 7367e4e..ac20107 100644
--- a/drivers/hid/hid-roccat-koneplus.c
+++ b/drivers/hid/hid-roccat-koneplus.c
@@ -774,8 +774,8 @@ static int __init koneplus_init(void)
static void __exit koneplus_exit(void)
{
- class_destroy(koneplus_class);
hid_unregister_driver(&koneplus_driver);
+ class_destroy(koneplus_class);
}
module_init(koneplus_init);
diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c
index 7664e2c..4eeb62f 100644
--- a/drivers/hid/hid-roccat-kovaplus.c
+++ b/drivers/hid/hid-roccat-kovaplus.c
@@ -703,8 +703,8 @@ static int __init kovaplus_init(void)
static void __exit kovaplus_exit(void)
{
- class_destroy(kovaplus_class);
hid_unregister_driver(&kovaplus_driver);
+ class_destroy(kovaplus_class);
}
module_init(kovaplus_init);
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c
index be4daa9..02a7243 100644
--- a/drivers/hid/hid-roccat-pyra.c
+++ b/drivers/hid/hid-roccat-pyra.c
@@ -685,8 +685,8 @@ static int __init pyra_init(void)
static void __exit pyra_exit(void)
{
- class_destroy(pyra_class);
hid_unregister_driver(&pyra_driver);
+ class_destroy(pyra_class);
}
module_init(pyra_init);
--
1.7.3.4
reply other threads:[~2011-01-30 12:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1296391107.2283.186.camel@neuromancer \
--to=erazor_de@users.sourceforge.net \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=hverkuil@xs4all.nl \
--cc=jkosina@suse.cz \
--cc=linux-doc@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@redhat.com \
--cc=rdunlap@xenotime.net \
--cc=weber@corscience.de \
/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