summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/swap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/swap.c b/src/core/swap.c
index 206bd939ca..97145a9974 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -427,7 +427,8 @@ static int swap_process_new_swap(Manager *m, const char *device, int prio, bool
return log_oom();
dn = udev_device_get_devnode(d);
- if (dn)
+ /* Skip dn==device, since that case will be handled below */
+ if (dn && !streq(dn, device))
r = swap_add_one(m, dn, device, prio, false, false, set_flags);
/* Add additional units for all symlinks */