UPSTREAM: 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>
(cherry picked from commit f81a8158d4)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
Sean Young
2017-12-13 16:30:22 -05:00
committed by Tao Huang
parent db9dd27256
commit 7497eaf0e0

View File

@@ -351,6 +351,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
@@ -363,7 +367,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);