Triggered by the tests when run as non-root. Simply ignore any attempt to
destroy a NULL device, which also matches the behaviour of libevdev_free().
Reported-by: Andreas Radke <a.radke@arcor.de>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Tested-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
LIBEVDEV_EXPORT void
libevdev_uinput_destroy(struct libevdev_uinput *uinput_dev)
{
+ if (!uinput_dev)
+ return;
+
ioctl(uinput_dev->fd, UI_DEV_DESTROY, NULL);
if (uinput_dev->fd_is_managed)
close(uinput_dev->fd);