aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2022-08-24 13:51:12 +0000
committerAleksander Morgado <aleksandermj@chromium.org>2022-08-25 13:33:45 +0000
commitff7e062e94fb779cae18be33d8d81f888033c98a (patch)
tree88855376c61f24c03b0fdd52f06d6bcb83da0177
parent0d6b6ebcf1f849a3e41a1a582fd2bf6d21fc1c1e (diff)
mtk: fix task completion when loading supported modes
-rw-r--r--plugins/mtk/mm-broadband-modem-mtk.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/plugins/mtk/mm-broadband-modem-mtk.c b/plugins/mtk/mm-broadband-modem-mtk.c
index 131f8daa..0ceca795 100644
--- a/plugins/mtk/mm-broadband-modem-mtk.c
+++ b/plugins/mtk/mm-broadband-modem-mtk.c
@@ -199,14 +199,12 @@ get_supported_modes_ready (MMBaseModem *self,
g_assert (r != NULL);
if (!g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &match_error)) {
- if (match_error) {
- g_propagate_error (&error, match_error);
- } else {
- g_set_error (&error,
- MM_CORE_ERROR,
- MM_CORE_ERROR_FAILED,
- "Failed to match EGMR response: %s", response);
- }
+ if (match_error)
+ g_task_return_error (task, error);
+ else
+ g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
+ "Failed to match EGMR response: %s", response);
+ g_object_unref (task);
g_match_info_free (match_info);
g_regex_unref (r);
@@ -214,11 +212,10 @@ get_supported_modes_ready (MMBaseModem *self,
}
if (!mm_get_int_from_match_info (match_info, 1, &device_type)) {
- g_set_error (&error,
- MM_CORE_ERROR,
- MM_CORE_ERROR_FAILED,
- "Failed to parse the allowed mode response: '%s'",
- response);
+ g_task_return_new_error (task, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
+ "Failed to parse the allowed mode response: '%s'",
+ response);
+ g_object_unref (task);
g_regex_unref (r);
g_match_info_free (match_info);