Em 24-06-2012 22:44, Douglas Bagnall escreveu: > hi, > > I probably should have sent that in reply to > http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/49740 > which is the problem it fixes. > > Some things which might be of interest: > > 1. I innocently followed the instructions on > http://www.linuxtv.org/wiki/index.php/Maintaining_Git_trees (i.e., > use v4l-dvb tree on top of linus tree) and spent a while looking at > IR/ir-sysfs.c instead of rc/rc-main.c. How stable it seemed! no > patches in years! So I added a warning at the top of the wiki page, > though a fix from someone who knows would be preferable. Please help us updating the wiki pages. Unfortunately, almost all developers have no time to update wiki pages, and expect community help on that. > > 2. From the above, I ended up reading a lot of ancient history and saw > that this was inadvertently sort of fixed for a few weeks in 2010 > between a08c7c68f702e2a2797a4035b and d8b4b5822f51e2142b731b42. > > 3. I wrote: > >> This patch avoids the NULL dereference, and ignores the issue of how >> this state of affairs came about in the first place. > > Would, in rc_unregister_device(), putting device_del(&dev->dev) before > ir_raw_event_unregister(dev) help? I've only been a kernel hacker for > two hours so I am honestly clueless, but it seems like that might > avert the race by hiding the structure from sysfs before it is pulled > apart. Reverting the order might help on your specific case, but device_del() does more than just removing the driver: it also can free some used structures, with might lead into an OOPS, if the driver is polling for IR. So, your patch is likely less risky to cause side effects. Regards, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html