On Tuesday 16 May 2006 22:46, Trent Piepho wrote: > On Tue, 16 May 2006, Johannes Stezenbach wrote: > > dvb_unregister_frontend(): > > ... > > > > + while(fe->ops->release) { > > + struct module *m = fe->ops->release(fe); > > + if (m) > > + module_put(m); > > + } > > + > > > > - this way of chaining release() looks just sick > > (is it even legal C code? can the optimizer not optimize > > away the fe->ops->release register reload and turn this > > into an endless loop?) > > - the module_put() in there is just as wrong as doing > > the module_put() inside release() > > Besides that, it has a bug. It will access memory that has been > kfree()'d. See my message here: > http://www.linuxtv.org/pipermail/linux-dvb/2006-May/010159.html > > In that message I posted an example of something that will work, with > just the core change, plus two example demod changes. Ah yup I get you. OK, we can use that if we decide to go that way. In the meantime, I've done a partial version with js's suggestions - it is at http://linuxtv.org/hg/~quincy/v4l-dvb-attach This removes chaining, and adds support for the SEC devices into the frontend_ops. I have not implemented any frontend changes yet. Also: there are no symbol_put_addrs() done yet. I've not yet had time to think on how do to do that - any suggestions? We could use a dvb_detach as js suggests, passing it the release() pointer to detach and then call symbol_put_adddr. I'm just uploading the previous tree to http://linuxtv.org/hg/~quincy/v4l-dvb-attach-old. Here is a first stab at dvb_detach (sorry if you already posted one johannes; I have zapped the message :( #define dvb_detach(FUNCTION, FE) \ do { \ if (FUNCTION) { \ FUNCTION(FE); \ symbol_put_addr(FUNCTION); \ } \ } while(0); We could either make the card drivers call this directly, or (for convenience) call it from dvb_unregister_frontend() instead of directly calling the release() methods like we do just now _______________________________________________ linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb