aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2022-09-12 12:04:24 +0000
committerAleksander Morgado <aleksandermj@chromium.org>2022-11-04 13:12:56 +0000
commitf98bcd5f58b8a10593b9401d8f15ee55659ff49e (patch)
tree693ae088f105bb242ae95adf355f5f3c62720a4c
parentf1fa2eb81e7bcce442831642b2b33105879c1c61 (diff)
iface-modem: refactor user request to list bearers
-rw-r--r--src/mm-iface-modem.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c
index 59f5a699..f5122d68 100644
--- a/src/mm-iface-modem.c
+++ b/src/mm-iface-modem.c
@@ -1203,12 +1203,12 @@ handle_delete_bearer (MmGdbusModem *skeleton,
/*****************************************************************************/
static gboolean
-handle_list_bearers (MmGdbusModem *skeleton,
+handle_list_bearers (MmGdbusModem *skeleton,
GDBusMethodInvocation *invocation,
- MMIfaceModem *self)
+ MMIfaceModem *self)
{
- GStrv paths;
- MMBearerList *list = NULL;
+ g_auto(GStrv) paths = NULL;
+ g_autoptr(MMBearerList) list = NULL;
if (mm_iface_modem_abort_invocation_if_state_not_reached (self, invocation, MM_MODEM_STATE_LOCKED))
return TRUE;
@@ -1217,20 +1217,13 @@ handle_list_bearers (MmGdbusModem *skeleton,
MM_IFACE_MODEM_BEARER_LIST, &list,
NULL);
if (!list) {
- g_dbus_method_invocation_return_error (invocation,
- MM_CORE_ERROR,
- MM_CORE_ERROR_FAILED,
+ g_dbus_method_invocation_return_error (invocation, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
"Bearer list not found");
return TRUE;
}
paths = mm_bearer_list_get_paths (list);
- mm_gdbus_modem_complete_list_bearers (skeleton,
- invocation,
- (const gchar *const *)paths);
-
- g_strfreev (paths);
- g_object_unref (list);
+ mm_gdbus_modem_complete_list_bearers (skeleton, invocation, (const gchar *const *)paths);
return TRUE;
}