modem-helpers-qmi: better handle no supported modes

Dell Snapdragon X62 before FCC Unlock reports no radio interfaces
from QMI and no device capabilities from MBIM. Instead of asserting
in mm_filter_supported_modes() when called from
mm_supported_modes_from_qmi_supported_modes_context() gracefully
handle the lack of supported modes.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
This commit is contained in:
Dan Williams
2025-04-09 13:19:50 +00:00
parent 467a53f189
commit f5ae14d0b2
4 changed files with 49 additions and 11 deletions
+6 -2
View File
@@ -1728,6 +1728,7 @@ mm_shared_qmi_load_supported_modes (MMIfaceModem *self,
MMQmiSupportedModesContext ctx = { 0 };
guint i;
GArray *combinations;
GError *error = NULL;
task = g_task_new (self, NULL, callback, user_data);
@@ -1753,8 +1754,11 @@ mm_shared_qmi_load_supported_modes (MMIfaceModem *self,
ctx.current_capabilities = priv->current_capabilities;
ctx.multimode = priv->multimode;
combinations = mm_supported_modes_from_qmi_supported_modes_context (&ctx, self);
g_task_return_pointer (task, combinations, (GDestroyNotify) g_array_unref);
combinations = mm_supported_modes_from_qmi_supported_modes_context (&ctx, self, &error);
if (error)
g_task_return_error (task, error);
else
g_task_return_pointer (task, combinations, (GDestroyNotify) g_array_unref);
g_object_unref (task);
}