[linux-dvb] Cinergy T2 dmx cleanup on disconnect

Markus Rechberger mrechberger at gmail.com
Thu Mar 9 23:24:37 CET 2006


Yes, I misplaced it, but it's definitelly missing ...

attached the new patch.

Signed-off-by: Markus Rechberger <mrechberger at gmail.com>


On 3/9/06, Johannes Stezenbach <js at linuxtv.org> wrote:
> On Thu, Mar 09, 2006Markus Rechberger wrote:
> > when looking at the cinergyT2.c driver I think I found a small devfs
> > related bug in the cleanup function.
> > When unloading the cinergyT2 module it doesn't clean up demux0 and
> > dvr0 device files, the attached patch should fix this.
> >
> > cinergyt2->demux.dmx.close(&cinergyt2->demux.dmx); only decreases a counter
> >
> > Can someone verify this? (I haven't tested it with any device yet)
> >
> > Signed-off-by: Markus Rechberger <mrechberger at gmail.com>
> >
> > Markus
>
> > diff -r a80fed4a425d linux/drivers/media/dvb/cinergyT2/cinergyT2.c
> > --- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c   Tue Feb 28 22:04:42 2006 -0500
> > +++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c   Thu Mar  9 00:20:08 2006 +0100
> > @@ -975,6 +975,8 @@ static void cinergyt2_disconnect (struct
> >       wake_up_interruptible(&cinergyt2->poll_wq);
> >
> >       cinergyt2->demux.dmx.close(&cinergyt2->demux.dmx);
> > +     dvb_dmxdev_release(&cinergyt2->dmxdev);
> > +     dvb_dmx_release(&cinergyt2->demux);
> >       cinergyt2->disconnect_pending = 1;
> >
> >       if (!atomic_read(&cinergyt2->inuse))
>
> Good catch!
> However, from looking at the code it seems the _release()
> calls should be added to cinergyt2_unregister() instead?
>
>
> Johannes
>


--
Markus Rechberger
-------------- next part --------------
diff -r a80fed4a425d linux/drivers/media/dvb/cinergyT2/cinergyT2.c
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c	Tue Feb 28 22:04:42 2006 -0500
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c	Thu Mar  9 23:19:39 2006 +0100
@@ -523,6 +523,8 @@ static int cinergyt2_open (struct inode 
 
 static void cinergyt2_unregister(struct cinergyt2 *cinergyt2)
 {
+	dvb_dmxdev_release(&cinergyt2->dmxdev);
+	dvb_dmx_release(&cinergyt2->demux);
 	dvb_unregister_device(cinergyt2->fedev);
 	dvb_unregister_adapter(&cinergyt2->adapter);
 


More information about the linux-dvb mailing list