diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-03-12 16:00:23 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2014-03-13 13:11:55 +0100 |
commit | 2b77b208daf9402472ba7fb709156a14eb487299 (patch) | |
tree | dfced7804a2557a7d32eeffd2fc728b8a92bccef /hw | |
parent | 0e972b6037d3709c13d46adef9d14b702f477abc (diff) |
xf86Xinput: release server managed fd before removing the device from the list
So that the fd in use test in systemd_logind_release_fd works properly.
Note we cannot change the test inside systemd_logind_release_fd as it must
work for devices which were never added to the xf86InputDevs too.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 36b92a9f7..a367ae3cb 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -766,6 +766,11 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) FreeInputAttributes(pInp->attrs); + if (pInp->flags & XI86_SERVER_FD) { + systemd_logind_release_fd(pInp->major, pInp->minor); + close(pInp->fd); + } + /* Remove the entry from the list. */ if (pInp == xf86InputDevs) xf86InputDevs = pInp->next; @@ -779,11 +784,6 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) /* Else the entry wasn't in the xf86InputDevs list (ignore this). */ } - if (pInp->flags & XI86_SERVER_FD) { - systemd_logind_release_fd(pInp->major, pInp->minor); - close(pInp->fd); - } - free((void *) pInp->driver); free((void *) pInp->name); xf86optionListFree(pInp->options); |