Skip to content

Commit f81a815

Browse files
seanyoungmchehab
authored andcommitted
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>
1 parent 7b3aa71 commit f81a815

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎drivers/media/rc/lirc_dev.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,10 @@ static ssize_t ir_lirc_transmit_ir(struct file *file, const char __user *buf,
347347
if (ret < 0)
348348
goto out_kfree;
349349

350+
kfree(txbuf);
351+
kfree(raw);
352+
mutex_unlock(&dev->lock);
353+
350354
/*
351355
* The lircd gap calculation expects the write function to
352356
* 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,
359363
schedule_timeout(usecs_to_jiffies(towait));
360364
}
361365

362-
ret = n;
366+
return n;
363367
out_kfree:
364368
kfree(txbuf);
365369
kfree(raw);

0 commit comments

Comments
 (0)