diff options
author | Mike Isely <isely@pobox.com> | 2010-05-14 23:30:29 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-06-01 00:19:58 -0400 |
commit | e3a5ee73e7223cda78f2770572c5ad01928496d6 (patch) | |
tree | e0d3879a2d0a108ea49159aaf2eeaae395473fd2 | |
parent | 7a6ac34848226e315e0d70333bb4ab83190d9f1d (diff) |
V4L/DVB: pvrusb2: Fix kernel oops on device tear-down
pvrusb2: Delete sysfs class device as the _very_ last step, after
we're sure that all driver contexts have gone away first. This is
important because it appears that there isn't any protection from a
struct device instance reference a deleted struct class instance. The
assumption in the kernel code appears to be that the class instance is
assumed to be around for the life of the device. So we can't let the
class instance go away until all referencing device instances are
gone; this is ensured by delaying removal of the class instance until
after the driver contexts have all gone away. This bug has been
present for a very long time but it didn't apparently become malignant
until recently (probably because of other changes in the kernel).
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-main.c b/drivers/media/video/pvrusb2/pvrusb2-main.c index eeacd0f67855..2254194aad57 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/drivers/media/video/pvrusb2/pvrusb2-main.c | |||
@@ -153,12 +153,12 @@ static void __exit pvr_exit(void) | |||
153 | 153 | ||
154 | usb_deregister(&pvr_driver); | 154 | usb_deregister(&pvr_driver); |
155 | 155 | ||
156 | pvr2_context_global_done(); | ||
157 | |||
156 | #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS | 158 | #ifdef CONFIG_VIDEO_PVRUSB2_SYSFS |
157 | pvr2_sysfs_class_destroy(class_ptr); | 159 | pvr2_sysfs_class_destroy(class_ptr); |
158 | #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ | 160 | #endif /* CONFIG_VIDEO_PVRUSB2_SYSFS */ |
159 | 161 | ||
160 | pvr2_context_global_done(); | ||
161 | |||
162 | pvr2_trace(PVR2_TRACE_INIT,"pvr_exit complete"); | 162 | pvr2_trace(PVR2_TRACE_INIT,"pvr_exit complete"); |
163 | } | 163 | } |
164 | 164 | ||