uinput: don't try to set the syspath twice

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@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
Peter Hutterer 2013-08-31 12:59:27 +10:00
parent 22d2a735c4
commit 37d37cdaea

View file

@ -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;
}
}