]> git.baikalelectronics.ru Git - kernel.git/commit
[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)
commit51078045e8378a9f7bbed9369661033b05c0c4c0
tree366b2860825d9a3b0338d553dd258c46a63622c1
parent0232b1a314e6e7b7cf8e6929c66e670fa4474ff5
[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