summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-04-24 23:08:09 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-04-25 09:36:51 +0200
commit52fd67e36591588f76c7d8e1f0a115ab1a1db74c (patch)
treeed82e02090ec768132a1660117d27835ee2411d6
parent2e6ba7cd09287bb984a356cf2606c64f5a779cd4 (diff)
downloadModemManager-52fd67e36591588f76c7d8e1f0a115ab1a1db74c.tar.gz
novatel: ensure error is set when $NWRAT response parser doesn't match
-rw-r--r--plugins/novatel/mm-broadband-modem-novatel.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/novatel/mm-broadband-modem-novatel.c b/plugins/novatel/mm-broadband-modem-novatel.c
index 9b978f05c..f03767523 100644
--- a/plugins/novatel/mm-broadband-modem-novatel.c
+++ b/plugins/novatel/mm-broadband-modem-novatel.c
@@ -86,7 +86,7 @@ nwrat_query_ready (MMBaseModem *self,
GError *error = NULL;
const gchar *response;
GRegex *r;
- GMatchInfo *match_info;
+ GMatchInfo *match_info = NULL;
gint a = -1;
gint b = -1;
@@ -103,13 +103,17 @@ nwrat_query_ready (MMBaseModem *self,
g_assert (r != NULL);
if (!g_regex_match_full (r, response, strlen (response), 0, 0, &match_info, &error)) {
- g_prefix_error (&error,
- "Failed to parse mode/tech response '%s': ",
- response);
- g_regex_unref (r);
- g_simple_async_result_take_error (simple, error);
+ if (error)
+ g_simple_async_result_take_error (simple, error);
+ else
+ g_simple_async_result_set_error (simple,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_FAILED,
+ "Couldn't match NWRAT reply: %s",
+ response);
g_simple_async_result_complete (simple);
g_object_unref (simple);
+ g_regex_unref (r);
return;
}