summaryrefslogtreecommitdiff
path: root/src/nm-policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm-policy.c')
-rw-r--r--src/nm-policy.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/nm-policy.c b/src/nm-policy.c
index d757800a5f..f9cd578444 100644
--- a/src/nm-policy.c
+++ b/src/nm-policy.c
@@ -150,13 +150,12 @@ _clear_ip6_subnet (gpointer key, gpointer value, gpointer user_data)
NMDevice *device = nm_manager_get_device_by_ifindex (nm_manager_get (),
GPOINTER_TO_INT (key));
- if (!device)
- return;
-
- /* We can not remove a subnet we already started announcing.
- * Just un-prefer it. */
- subnet->preferred = 0;
- nm_device_use_ip6_subnet (device, subnet);
+ if (device) {
+ /* We can not remove a subnet we already started announcing.
+ * Just un-prefer it. */
+ subnet->preferred = 0;
+ nm_device_use_ip6_subnet (device, subnet);
+ }
g_slice_free (NMPlatformIP6Address, subnet);
}