aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dan@ioncontrol.co>2025-03-06 08:32:36 -0600
committerDan Williams <dan@ioncontrol.co>2025-05-08 18:14:24 -0500
commit4b0d3b7147a3fa8f669870e0a740a2b0121a475c (patch)
tree24d0ae43b13def0710d7e1e138b1d1dc5d5b561e
parent352b8ed53d69ef1ce4665c1dd76404451d3918a6 (diff)
broadband-modem-qmi: use correct profile index in error message
Instead of using the loop index, use the actual profile index because they aren't always the same. Signed-off-by: Dan Williams <dan@ioncontrol.co>
-rw-r--r--src/mm-broadband-modem-qmi.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index ee6310a9..16f2a088 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -6722,6 +6722,14 @@ modem_3gpp_profile_manager_list_profiles_finish (MMIfaceModem3gppProfileManager
static void get_next_profile_settings (GTask *task);
+static QmiMessageWdsGetProfileListOutputProfileListProfile *
+get_current_qmi_profile_from_list (ListProfilesContext *ctx)
+{
+ return &g_array_index (ctx->qmi_profiles,
+ QmiMessageWdsGetProfileListOutputProfileListProfile,
+ ctx->i);
+}
+
static void
get_next_profile_settings_ready (MMIfaceModem3gppProfileManager *self,
GAsyncResult *res,
@@ -6735,7 +6743,12 @@ get_next_profile_settings_ready (MMIfaceModem3gppProfileManager *self,
profile = modem_3gpp_profile_manager_get_profile_finish (self, res, &error);
if (!profile) {
- g_prefix_error (&error, "Couldn't load settings from profile index %u: ", ctx->i);
+ QmiMessageWdsGetProfileListOutputProfileListProfile *current;
+
+ current = get_current_qmi_profile_from_list (ctx);
+ g_prefix_error (&error,
+ "Couldn't load settings from profile index %u: ",
+ current->profile_index);
g_task_return_error (task, error);
g_object_unref (task);
return;
@@ -6765,7 +6778,7 @@ get_next_profile_settings (GTask *task)
return;
}
- current = &g_array_index (ctx->qmi_profiles, QmiMessageWdsGetProfileListOutputProfileListProfile, ctx->i);
+ current = get_current_qmi_profile_from_list (ctx);
modem_3gpp_profile_manager_get_profile (MM_IFACE_MODEM_3GPP_PROFILE_MANAGER (self),
current->profile_index,
(GAsyncReadyCallback)get_next_profile_settings_ready,