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.
This commit is contained in:
Thomas Haller 2023-06-13 11:23:15 +02:00
parent 44076802a9
commit 6d75b7f348
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;
}