[media] lirc_dev: fix potential segfault
authorAndi Shyti <andi.shyti@samsung.com>
Wed, 6 Jul 2016 09:01:26 +0000 (06:01 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 13 Jul 2016 18:28:25 +0000 (15:28 -0300)
commit8e5fa4c67d6387d40e2ae350e96fca939ba5e681
tree366b2860825d9a3b0338d553dd258c46a63622c1
parent62e92682c08885e91113ba742573e736c85db0e4
[media] lirc_dev: fix potential segfault

When opening or closing a lirc character device, the framework
provides to the user the possibility to keep track of opening or
closing of the device by calling two functions:

 - set_use_inc() when opening the device
 - set_use_dec() when closing the device

if those are not set by the lirc user, the system segfaults.
Check the pointer value before calling the above functions.

Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/lirc_dev.c