# \[PATCH\] input: move check for same handler in input\_pass\_event

- From: Kristen Carlson Accardi \<hidden\>
- Date: 2011-01-06 22:23:18 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2011/01/8915808
- Thread: https://ratatoskr.run/linux-input/2011/01/8915808/t.md

```text
If the handler that injected an event is the same,
just skip the filter, but allow the handler->event()
routine to be called.  This allows evdev to be able to
be used to loopback events.
---
 drivers/input/input.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index db409d6..cdeb929 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -98,16 +98,15 @@ static void input_pass_event(struct input_dev *dev,
 			 * particular event we want to skip it to avoid
 			 * filters firing again and again.
 			 */
-			if (handler == src_handler)
-				continue;
-
 			if (!handler->filter) {
 				if (filtered)
 					break;
 
 				handler->event(handle, type, code, value);
 
-			} else if (handler->filter(handle, type, code, value))
+			} else if (handler != src_handler &&
+					handler->filter(handle, type, code,
+								value))
 				filtered = true;
 		}
 	}
-- 
1.7.2.3

```
