aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-03-16 09:53:27 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-03-16 09:58:08 +0100
commit38f6e4eec920b2557ed7ba07310ce0160eab2cc9 (patch)
treee1fca82814815f0dff57d7f2909dfaebea3bf8b0
parenta6a721f3a8e010c0eefd7e38c4781f6e1a0c1e89 (diff)
broadband-modem-mbim: fix segfault when loading capabilities
If loading capabilities using QMI over MBIM returns NONE without an explicit error, the process would crash. Fix that by making the error optional when NONE is received. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/185
-rw-r--r--src/mm-broadband-modem-mbim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c
index a6b6ec5f..931967f6 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -365,7 +365,7 @@ qmi_load_current_capabilities_ready (MMIfaceModem *self,
ctx = g_task_get_task_data (task);
ctx->current_qmi = mm_shared_qmi_load_current_capabilities_finish (self, res, &error);
- if (!ctx->current_qmi) {
+ if (error) {
mm_dbg ("Couldn't load currrent capabilities using QMI over MBIM: %s", error->message);
g_clear_error (&error);
}