summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/lirc_dev.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-12-13 22:30:22 +0100
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 21:22:24 +0100
commitf81a8158d4fb9cbbd6413adf4b220d6dcf327c40 (patch)
treea778211e6d8cf329e1662302dcf05b9373228a60 /drivers/media/rc/lirc_dev.c
parentmedia: lirc: no need to recalculate duration (diff)
downloadlinux-f81a8158d4fb9cbbd6413adf4b220d6dcf327c40.tar.xz
linux-f81a8158d4fb9cbbd6413adf4b220d6dcf327c40.zip
media: lirc: release lock before sleep
There is no reason to hold the lock while we wait for the IR to transmit. 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>
Diffstat (limited to 'drivers/media/rc/lirc_dev.c')
-rw-r--r--drivers/media/rc/lirc_dev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 1fc1fd665bce..713d42e4b661 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -347,6 +347,10 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
if (ret < 0)
goto out_kfree;
+ kfree(txbuf);
+ kfree(raw);
+ mutex_unlock(&dev->lock);
+
/*
* The lircd gap calculation expects the write function to
* wait for the actual IR signal to be transmitted before
@@ -359,7 +363,7 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
schedule_timeout(usecs_to_jiffies(towait));
}
- ret = n;
+ return n;
out_kfree:
kfree(txbuf);
kfree(raw);