From bc41dd40cdd8db66c1929465df9b8babf1bd0af1 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 4 Apr 2013 16:59:19 +0200 Subject: [PATCH] broadband-bearer: ensure we close the port even if we got cancelled When there is an error in the connection attempt we need to close the dialling port ourselves. In the case where we got an error and we also got cancelled, we need to make sure that the port gets closed. --- src/mm-broadband-bearer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mm-broadband-bearer.c b/src/mm-broadband-bearer.c index 2e4be249..c34867d3 100644 --- a/src/mm-broadband-bearer.c +++ b/src/mm-broadband-bearer.c @@ -501,6 +501,9 @@ extended_error_ready (MMBaseModem *modem, { const gchar *result; + /* Close the dialling port as we got an error */ + mm_serial_port_close (MM_SERIAL_PORT (ctx->dial_port)); + /* If cancelled, complete */ if (dial_3gpp_context_complete_and_free_if_cancelled (ctx)) return; @@ -520,9 +523,6 @@ extended_error_ready (MMBaseModem *modem, ctx->saved_error = NULL; - /* Close the dialling port as we got an error */ - mm_serial_port_close (MM_SERIAL_PORT (ctx->dial_port)); - /* Done with errors */ dial_3gpp_context_complete_and_free (ctx); }