From 71a3942b3fe712b95becab5159639ec6aecc0a7c Mon Sep 17 00:00:00 2001 From: Jack Song Date: Wed, 6 Jul 2022 11:07:06 +0800 Subject: mm-bearer-mbim: ignore mbim status error 'SIM not inserted' while disconnecting Ignore the error SIM_NOT_INSERTED when ModemManager disable modem after SIM card removed Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/578 --- src/mm-bearer-mbim.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/mm-bearer-mbim.c b/src/mm-bearer-mbim.c index 542881e3..057f006a 100644 --- a/src/mm-bearer-mbim.c +++ b/src/mm-bearer-mbim.c @@ -1584,6 +1584,14 @@ disconnect_set_ready (MbimDevice *device, goto out; } + if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_SIM_NOT_INSERTED)) { + g_clear_error (&error); + g_clear_error (&inner_error); + mm_obj_dbg (self, "SIM card not inserted: already disconnected"); + /* success */ + goto out; + } + if (g_error_matches (error, MBIM_STATUS_ERROR, MBIM_STATUS_ERROR_FAILURE) && parsed_result && nw_error != 0) { g_assert (!inner_error); g_error_free (error); -- cgit v1.2.3-70-g09d2