From 7cebf2ee8b7e39c06c93b593b0848a7baf9e73a8 Mon Sep 17 00:00:00 2001 From: Sean Young Date: Fri, 20 Jan 2017 10:10:11 -0200 Subject: [PATCH] [media] lirc: fix null dereference for tx-only devices tx-only RC devices do not have a receive buffer. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab --- drivers/media/rc/lirc_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index e0e2297f13d1..0030ce01babc 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -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) -- 2.20.1