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
This commit is contained in:
Aleksander Morgado
2020-03-16 09:53:27 +01:00
parent a6a721f3a8
commit 38f6e4eec9

View File

@@ -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);
}