]> git.baikalelectronics.ru Git - kernel.git/commit
V4L/DVB: pvrusb2: Fix kernel oops on device tear-down
authorMike Isely <isely@pobox.com>
Sat, 15 May 2010 03:30:29 +0000 (00:30 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 1 Jun 2010 04:19:58 +0000 (01:19 -0300)
commit88c47a4719c9d2e7ae0fd76b1dc9c583813b794f
treee0d3879a2d0a108ea49159aaf2eeaae395473fd2
parent4093d476fefa81858f09a84d3285fd4d501505b9
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>
drivers/media/video/pvrusb2/pvrusb2-main.c