mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 14:00:29 +01:00
udev: plug leak when double-resuming
Leak when calling libinput_suspend(); libinput_resume(); libinput_resume(); Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
ded615c64f
commit
c789a0fdd7
1 changed files with 5 additions and 0 deletions
|
|
@ -204,6 +204,9 @@ udev_input_enable(struct udev_input *input)
|
|||
struct udev *udev = input->udev;
|
||||
int fd;
|
||||
|
||||
if (input->udev_monitor)
|
||||
return 0;
|
||||
|
||||
input->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
|
||||
if (!input->udev_monitor) {
|
||||
log_info("udev: failed to create the udev monitor\n");
|
||||
|
|
@ -216,6 +219,7 @@ udev_input_enable(struct udev_input *input)
|
|||
if (udev_monitor_enable_receiving(input->udev_monitor)) {
|
||||
log_info("udev: failed to bind the udev monitor\n");
|
||||
udev_monitor_unref(input->udev_monitor);
|
||||
input->udev_monitor = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -226,6 +230,7 @@ udev_input_enable(struct udev_input *input)
|
|||
input);
|
||||
if (!input->udev_monitor_source) {
|
||||
udev_monitor_unref(input->udev_monitor);
|
||||
input->udev_monitor = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue