summaryrefslogtreecommitdiff
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 10:59:55 +0100
commit994a9a2866330751f035b0daf7a72d800c501231 (patch)
tree6da83bebc3124808ba1beea41b8bbb99aae2130c
parent60413ba975a31e0c9b4b7a9ccc1aab5639849ec6 (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 (cherry picked from commit 38f6e4eec920b2557ed7ba07310ce0160eab2cc9)
-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 cf477db3..050b173f 100644
--- a/src/mm-broadband-modem-mbim.c
+++ b/src/mm-broadband-modem-mbim.c
@@ -364,7 +364,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);
}