mirror of
https://github.com/torvalds/linux.git
synced 2026-11-30 02:23:05 +00:00
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 <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
7b3aa7146e
commit
f81a8158d4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user