mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-24 17:00:07 +01:00
Ignore NULL as argument in libevdev_uinput_destroy()
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>
This commit is contained in:
parent
b5a39e9e05
commit
d0af7f2851
1 changed files with 3 additions and 0 deletions
|
|
@ -334,6 +334,9 @@ error:
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue