aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-12-13 16:30:22 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 15:22:24 -0500
commitf81a8158d4fb9cbbd6413adf4b220d6dcf327c40 (patch)
treea778211e6d8cf329e1662302dcf05b9373228a60
parent7b3aa7146eeed0f2356a92c0edf5e5c829121070 (diff)
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>
-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,
347 if (ret < 0) 347 if (ret < 0)
348 goto out_kfree; 348 goto out_kfree;
349 349
350 kfree(txbuf);
351 kfree(raw);
352 mutex_unlock(&dev->lock);
353
350 /* 354 /*
351 * The lircd gap calculation expects the write function to 355 * The lircd gap calculation expects the write function to
352 * wait for the actual IR signal to be transmitted before 356 * 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,
359 schedule_timeout(usecs_to_jiffies(towait)); 363 schedule_timeout(usecs_to_jiffies(towait));
360 } 364 }
361 365
362 ret = n; 366 return n;
363out_kfree: 367out_kfree:
364 kfree(txbuf); 368 kfree(txbuf);
365 kfree(raw); 369 kfree(raw);