summaryrefslogtreecommitdiff
path: root/src/network/networkd-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/networkd-manager.c')
-rw-r--r--src/network/networkd-manager.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index d59b9139a3..1b5837e42c 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -22,6 +22,7 @@
#include "path-util.h"
#include "networkd.h"
#include "libudev-private.h"
+#include "udev-util.h"
int manager_new(Manager **ret) {
_cleanup_manager_free_ Manager *m = NULL;
@@ -204,19 +205,13 @@ finish:
static int manager_dispatch_link_udev(sd_event_source *source, int fd, uint32_t revents, void *userdata) {
Manager *m = userdata;
struct udev_monitor *monitor = m->udev_monitor;
- struct udev_device *device;
- int r;
+ _cleanup_udev_device_unref_ struct udev_device *device = NULL;
device = udev_monitor_receive_device(monitor);
if (!device)
return -ENOMEM;
- r = manager_process_link(m, device);
- if (r < 0)
- return r;
-
- udev_device_unref(device);
-
+ manager_process_link(m, device);
return 0;
}