Message ID | 4E4D8DFD.5060800@yahoo.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Em 20-08-2011 04:37, Chris Rankin escreveu: > + > + if (dev->state & DEV_DISCONNECTED) { > + /* We cannot tell the device to sleep > + * once it has been unplugged. */ > + prevent_sleep(&dvb->fe[0]->ops); > + prevent_sleep(&dvb->fe[1]->ops); This will cause an OOPS if dvb->fe[n] == NULL. > + } > + -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- On Sat, 20/8/11, Mauro Carvalho Chehab <mchehab@redhat.com> wrot > > This will cause an OOPS if dvb->fe[n] == NULL. > OK, that's trivially fixable. I'll send you an updated patch. Is it safe to assume that dvb->fe[0] at least will always be non-NULL? Cheers, Chris -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--- linux-3.0/drivers/media/video/em28xx/em28xx-core.c.orig 2011-08-18 23:05:50.000000000 +0100 +++ linux-3.0/drivers/media/video/em28xx/em28xx-core.c 2011-08-18 23:07:02.000000000 +0100 @@ -1186,8 +1186,8 @@ list_for_each_entry(dev, &em28xx_devlist, devlist) { ops->init(dev); } - printk(KERN_INFO "Em28xx: Initialized (%s) extension\n", ops->name); mutex_unlock(&em28xx_devlist_mutex); + printk(KERN_INFO "Em28xx: Initialized (%s) extension\n", ops->name); return 0; } EXPORT_SYMBOL(em28xx_register_extension); @@ -1200,9 +1200,9 @@ list_for_each_entry(dev, &em28xx_devlist, devlist) { ops->fini(dev); } - printk(KERN_INFO "Em28xx: Removed (%s) extension\n", ops->name); list_del(&ops->next); mutex_unlock(&em28xx_devlist_mutex); + printk(KERN_INFO "Em28xx: Removed (%s) extension\n", ops->name); } EXPORT_SYMBOL(em28xx_unregister_extension);
Two more patches: a) clean up resources more reliably if em28xx_init_dev() fails, b) move two printk() statements outside the mutex lock Cheers, Chris Signed-off-by: Chris Rankin <rankincj@yahoo.com>