linux/drivers/media
Jesper Juhl c659395935 [media] tm6000: Don't use pointer after freeing it in tm6000_ir_fini()
In tm6000_ir_fini() there seems to be a problem.
rc_unregister_device(ir->rc); calls rc_free_device() on the pointer it is
given, which frees it.

Subsequently the function does:

  if (!ir->polling)
    __tm6000_ir_int_stop(ir->rc);

and __tm6000_ir_int_stop() dereferences the pointer it is given, which
has already been freed.

and it also does:

  tm6000_ir_stop(ir->rc);

which also dereferences the (already freed) pointer.

So, it seems that the call to rc_unregister_device() should be move
below the calls to __tm6000_ir_int_stop() and tm6000_ir_stop(), so
those don't operate on a already freed pointer.

But, I must admit that I don't know this code *at all*, so someone who
knows the code should take a careful look before applying this
patch. It is based purely on inspection of facts of what is beeing
freed where and not at all on understanding what the code does or why.
I don't even have a means to test it, so beyond testing that the
change compiles it has seen no testing what-so-ever.

Anyway, here's a proposed patch.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-02-08 10:59:56 -02:00
..
common [media] mt2063: increase frequency_max to tune channel 69 2012-02-08 10:53:06 -02:00
dvb [media] it913x ver 1.24 Make 0x60 default on version 2 devices 2012-02-08 10:53:59 -02:00
radio Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-01-15 12:49:56 -08:00
rc Merge tag 'v3.3-rc1' into staging/for_v3.3 2012-01-21 23:23:15 -02:00
video [media] tm6000: Don't use pointer after freeing it in tm6000_ir_fini() 2012-02-08 10:59:56 -02:00
Kconfig [media] DVB: dvb-net, make the kconfig text helpful 2011-07-27 17:53:09 -03:00
Makefile
media-device.c [media] media: fix truncated entity specification 2011-12-20 09:31:50 -02:00
media-devnode.c [media] media: Fix media device minor registration 2011-06-01 13:24:23 -03:00
media-entity.c [media] media: Properly handle link flags in link setup, link notify callback 2011-04-17 07:43:32 -03:00