From 74b643dac475e29f53f4132d2349ec1dba3c9e44 Mon Sep 17 00:00:00 2001 From: Stefan Achatz Date: Sun, 30 Jan 2011 13:38:27 +0100 Subject: HID: roccat: Fix NULL pointer dereference when unloading module 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 Signed-off-by: Jiri Kosina --- drivers/hid/hid-roccat-koneplus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/hid/hid-roccat-koneplus.c') diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c index 7367e4edfa6c..ac2010732495 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); -- cgit v1.2.2