[media] lirc: fix error paths in lirc_cdev_add()
authorSean Young <sean@mess.org>
Sat, 26 Nov 2016 21:31:24 +0000 (19:31 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 1 Dec 2016 14:46:00 +0000 (12:46 -0200)
commitb40769ee2ed09ed6c6da33b0cbdf423ff94f685b
tree1cde9fd2230e29b051db457b9b6b47f4ae130658
parent003611334d5592984e319e08c6b66825aca00290
[media] lirc: fix error paths in lirc_cdev_add()

"c77d17c0 [media] lirc: use-after free" introduces two problems:
cdev_del() can be called with a NULL argument, and the kobject_put()
path will cause a double free.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/lirc_dev.c