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.

(cherry picked from commit 6d75b7f348)
This commit is contained in:
Thomas Haller 2023-06-13 11:23:15 +02:00
parent 8e0a61d4e2
commit 16263015cb
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -4516,6 +4516,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) {
@ -4527,14 +4535,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;
}