Skip to content

Commit

Permalink
V4L/DVB (6548): pvrusb2: Fix oops on module removal
Browse files Browse the repository at this point in the history
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 <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Nov 4, 2007
1 parent ac72fed commit 4f663bd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/media/video/pvrusb2/pvrusb2-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,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);
Expand Down

0 comments on commit 4f663bd

Please sign in to comment.