소스 검색

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 <erazor_de@users.sourceforge.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Stefan Achatz 14 년 전
부모
커밋
74b643dac4
5개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      drivers/hid/hid-roccat-arvo.c
  2. 1 1
      drivers/hid/hid-roccat-kone.c
  3. 1 1
      drivers/hid/hid-roccat-koneplus.c
  4. 1 1
      drivers/hid/hid-roccat-kovaplus.c
  5. 1 1
      drivers/hid/hid-roccat-pyra.c

+ 1 - 1
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);

+ 1 - 1
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);

+ 1 - 1
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);

+ 1 - 1
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);

+ 1 - 1
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);