[PATCH libevdev 4/9] uinput: don't try to set the syspath twice

Peter Hutterer peter.hutterer at who-t.net
Tue Sep 3 00:07:42 PDT 2013


If we have it, stop searching for it. Otherwise a second device with the
same name would overwrite the first, causing a leak.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 libevdev/libevdev-uinput.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libevdev/libevdev-uinput.c b/libevdev/libevdev-uinput.c
index de2833e..88ec313 100644
--- a/libevdev/libevdev-uinput.c
+++ b/libevdev/libevdev-uinput.c
@@ -230,6 +230,7 @@ fetch_syspath_and_devnode(struct libevdev_uinput *uinput_dev)
 			strcat(buf, namelist[i]->d_name);
 			uinput_dev->syspath = strdup(buf);
 			uinput_dev->devnode = fetch_device_node(buf);
+			break;
 		}
 	}
 
-- 
1.8.2.1



More information about the Input-tools mailing list