From 38f6e4eec920b2557ed7ba07310ce0160eab2cc9 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 16 Mar 2020 09:53:27 +0100 Subject: 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 --- src/mm-broadband-modem-mbim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); } -- cgit v1.2.3-70-g09d2