summaryrefslogtreecommitdiffstats
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-01-23 11:29:13 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-05-19 09:35:18 -0700
commitb55eb298418aebc27a1a9e7759736def2757af79 (patch)
tree8b88d787aa42c185717feceae25ca48f1b054ea8 /drivers/input/input.c
parente9000b7978541f73a4bc100117fd417ab08a2a60 (diff)
downloadlinux-stable-b55eb298418aebc27a1a9e7759736def2757af79.tar.gz
linux-stable-b55eb298418aebc27a1a9e7759736def2757af79.tar.bz2
linux-stable-b55eb298418aebc27a1a9e7759736def2757af79.zip
Input: feed more data into entropy pool
Commit 4369c64c79a22 ("Input: Send events one packet at a time") significantly reduced amount of entropy input core was feeding to the rest of the system, because only the very first event in the event block would be used as source of entropy. With this change we will be calling add_input_randomness() for every event that is not filtered by the input core as a duplicate. In addition, all EV_SYN events are ignored. Acked-by: Henrik Rydberg <rydberg@bitmath.org> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 880605959aa6..fbe4fe8d7550 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -153,8 +153,6 @@ static void input_pass_values(struct input_dev *dev,
rcu_read_unlock();
- add_input_randomness(vals->type, vals->code, vals->value);
-
/* trigger auto repeat for key events */
if (test_bit(EV_REP, dev->evbit) && test_bit(EV_KEY, dev->evbit)) {
for (v = vals; v != vals + count; v++) {
@@ -371,9 +369,10 @@ static int input_get_disposition(struct input_dev *dev,
static void input_handle_event(struct input_dev *dev,
unsigned int type, unsigned int code, int value)
{
- int disposition;
+ int disposition = input_get_disposition(dev, type, code, &value);
- disposition = input_get_disposition(dev, type, code, &value);
+ if (disposition != INPUT_IGNORE_EVENT && type != EV_SYN)
+ add_input_randomness(type, code, value);
if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event)
dev->event(dev, type, code, value);