summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-06-13 11:23:15 +0200
committerThomas Haller <thaller@redhat.com>2023-06-14 11:15:52 +0200
commit6d75b7f348e6fc62287e1f7f90650cbf094c05f3 (patch)
tree32ab263d878b084161c85c37f0cc0705c89126e4
parent44076802a9093e439d16aa73f092a0bc6ed70ca5 (diff)
core: reorder return in find_master()
It feels ugly to set the out arguments, in case we are failing the function. Note that there is no change in behavior here. This is purely cosmetic.
-rw-r--r--src/core/nm-manager.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/nm-manager.c b/src/core/nm-manager.c
index 63645227ee..d724f84eff 100644
--- a/src/core/nm-manager.c
+++ b/src/core/nm-manager.c
@@ -5005,6 +5005,14 @@ find_master(NMManager *self,
nm_device_get_iface(master_device));
}
+ if (!master_device && !master_connection) {
+ g_set_error_literal(error,
+ NM_MANAGER_ERROR,
+ NM_MANAGER_ERROR_UNKNOWN_DEVICE,
+ "Master connection not found or invalid");
+ return FALSE;
+ }
+
NM_SET_OUT(out_master_connection, master_connection);
NM_SET_OUT(out_master_device, master_device);
if (out_master_ac && master_connection) {
@@ -5016,14 +5024,6 @@ find_master(NMManager *self,
NULL);
}
- if (!master_device && !master_connection) {
- g_set_error_literal(error,
- NM_MANAGER_ERROR,
- NM_MANAGER_ERROR_UNKNOWN_DEVICE,
- "Master connection not found or invalid");
- return FALSE;
- }
-
return TRUE;
}