about summary refs log tree commit diff
path: root/src/core/nm-manager.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2025-09-12 19:47:12 +0200
committerMichael Biebl <biebl@debian.org>2025-09-12 19:47:12 +0200
commitb1655e06d992cd690c0b74f8292ef62f669ecdb1 (patch)
tree8b74f02013d9507317e19f4f415c218d619269f8 /src/core/nm-manager.c
parent6a11a05e66efbf567f52e6a354540f18f3e023b6 (diff)
parentbc5f10851bffd6af1c2855635be7a28b6dba3195 (diff)
Update upstream source from tag 'upstream/1.54.1'
Update to upstream version '1.54.1'
with Debian dir e162c0a8d88871855453474e7d890fafe7ea06aa
Diffstat (limited to 'src/core/nm-manager.c')
-rw-r--r--src/core/nm-manager.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c
index fce37071..9dc7bc01 100644
--- a/src/core/nm-manager.c
+++ b/src/core/nm-manager.c
@@ -5718,6 +5718,7 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError **
     GError                  *local = NULL;
     NMConnectionMultiConnect multi_connect;
     const char              *parent_spec;
+    gboolean                 did_realize = FALSE;
 
     g_return_val_if_fail(NM_IS_MANAGER(self), FALSE);
     g_return_val_if_fail(NM_IS_ACTIVE_CONNECTION(active), FALSE);
@@ -5892,6 +5893,7 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError **
                                nm_device_get_iface(device));
                 return FALSE;
             }
+            did_realize = TRUE;
         }
     }
 
@@ -5923,7 +5925,7 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError **
                         "The controller connection '%s' is not compatible with '%s'",
                         nm_settings_connection_get_id(controller_connection),
                         nm_settings_connection_get_id(sett_conn));
-            return FALSE;
+            goto err_unrealize;
         }
 
         if (!controller_ac) {
@@ -5946,7 +5948,7 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError **
                                    "Controller connection '%s' can't be activated: ",
                                    nm_settings_connection_get_id(controller_connection));
                 }
-                return FALSE;
+                goto err_unrealize;
             }
         }
 
@@ -6040,7 +6042,7 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError **
                                 NM_MANAGER_ERROR,
                                 NM_MANAGER_ERROR_DEPENDENCY_FAILED,
                                 "Activation failed because the device is unmanaged");
-            return FALSE;
+            goto err_unrealize;
         }
     }
 
@@ -6048,6 +6050,11 @@ _internal_activate_device(NMManager *self, NMActiveConnection *active, GError **
     active_connection_add(self, active);
     nm_device_queue_activation(device, NM_ACT_REQUEST(active));
     return TRUE;
+
+err_unrealize:
+    if (did_realize)
+        nm_device_unrealize(device, TRUE, NULL);
+    return FALSE;
 }
 
 static gboolean