[media] lirc: fix null dereference for tx-only devices
authorSean Young <sean@mess.org>
Fri, 20 Jan 2017 12:10:11 +0000 (10:10 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 31 Jan 2017 09:32:27 +0000 (07:32 -0200)
tx-only RC devices do not have a receive buffer.

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

index e0e2297..0030ce0 100644 (file)
@@ -468,7 +468,7 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file)
                if (retval) {
                        module_put(cdev->owner);
                        ir->open--;
-               } else {
+               } else if (ir->buf) {
                        lirc_buffer_clear(ir->buf);
                }
                if (ir->task)