From 0d047cc5c24e86c3087e7c2300d048f48a11988a Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Fri, 2 Nov 2007 22:06:42 -0500 Subject: pvrusb2: Fix oops on module removal From: Mike Isely The pvrusb2 driver is tearing down its sysfs related pieces in the incorrect order. This leaves dangling pointers which causes the kernel device core to oops. The problem has been present virtually forever but became malignant with the changeover to the way of handling /sys/class. Fix is just to make sure we don't tear down the class structure until AFTER the driver instances are deregistered. Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/video/pvrusb2/pvrusb2-main.c') diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c index 73be66dd3..687096d1f 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -140,14 +140,13 @@ static int __init pvr_init(void) static void __exit pvr_exit(void) { - pvr2_trace(PVR2_TRACE_INIT,"pvr_exit"); + usb_deregister(&pvr_driver); + #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS pvr2_sysfs_class_destroy(class_ptr); #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ - - usb_deregister(&pvr_driver); } module_init(pvr_init); -- cgit v1.2.3