[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1455590972-2120-1-git-send-email-keithp@keithp.com>
Date: Mon, 15 Feb 2016 18:49:32 -0800
From: Keith Packard <keithp@...thp.com>
To: linux-usb@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, Keith Packard <keithp@...thp.com>
Subject: [PATCH] usb: check for signals in chaoskey read function
Call signal_pending before reading a chunk of data from the device so
that long read operations can be interrupted with a signal.
Signed-off-by: Keith Packard <keithp@...thp.com>
---
drivers/usb/misc/chaoskey.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c
index 23c7948..ab87db2 100644
--- a/drivers/usb/misc/chaoskey.c
+++ b/drivers/usb/misc/chaoskey.c
@@ -394,6 +394,13 @@ static ssize_t chaoskey_read(struct file *file,
if (result)
goto bail;
if (dev->valid == dev->used) {
+
+ if (signal_pending(current)) {
+ result = -ERESTARTSYS;
+ mutex_unlock(&dev->lock);
+ goto bail;
+ }
+
result = _chaoskey_fill(dev);
if (result) {
mutex_unlock(&dev->lock);
--
2.7.0
Powered by blists - more mailing lists