From 58e617e03c17be9a16a5cf1229c8b4b01bd5b64f Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 13 Oct 2021 12:45:00 +0200 Subject: iface-modem-sar: fix initialization sequence completion We cannot just return without completing the GTask. If we see the support check method failed, just keep on with the state machine so that the GTask is completed in the FAIL_IF_UNSUPPORTED step. Also, don't assume GError is set if FALSE is returned. This is the only kind of async method where we allow this right now. --- src/mm-iface-modem-sar.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/mm-iface-modem-sar.c b/src/mm-iface-modem-sar.c index b1d3def4..2e92af1a 100644 --- a/src/mm-iface-modem-sar.c +++ b/src/mm-iface-modem-sar.c @@ -344,10 +344,11 @@ check_support_ready (MMIfaceModemSar *self, GError *error = NULL; if (!MM_IFACE_MODEM_SAR_GET_INTERFACE (self)->check_support_finish (self, res, &error)) { - /* This error shouldn't be treated as critical */ - mm_obj_dbg (self, "SAR support check failed: %s", error->message); - g_error_free (error); - return; + if (error) { + /* This error shouldn't be treated as critical */ + mm_obj_dbg (self, "SAR support check failed: %s", error->message); + g_error_free (error); + } } else { /* SAR is supported! */ g_object_set_qdata (G_OBJECT (self), -- cgit v1.2.3-70-g09d2