aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-modem-sierra-gsm.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-06-16 17:12:41 +0200
committerGuido Günther <agx@sigxcpu.org>2014-02-05 08:38:26 +0100
commit59ed3390b9a798ff8bf9133cbc28c4539ad99f42 (patch)
tree2009d57abbd0061b4ee230516e004eb83509aac5 /plugins/mm-modem-sierra-gsm.c
parentbbf8a053e07c66f336ed46a7fb6105dc30645596 (diff)
parent3dbe8df8bfe8741e1b9a48b56e41517816f17dc1 (diff)
Imported Debian patch 0.4.997-1debian/0.4.997-1
Diffstat (limited to 'plugins/mm-modem-sierra-gsm.c')
-rw-r--r--plugins/mm-modem-sierra-gsm.c48
1 files changed, 45 insertions, 3 deletions
diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c
index d4636d7..6d4e4d5 100644
--- a/plugins/mm-modem-sierra-gsm.c
+++ b/plugins/mm-modem-sierra-gsm.c
@@ -74,9 +74,15 @@ get_allowed_mode_done (MMAtSerialPort *port,
GRegex *r = NULL;
GMatchInfo *match_info;
- info->error = mm_modem_check_removed (info->modem, error);
- if (info->error)
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
+ if (error) {
+ info->error = g_error_copy (error);
goto done;
+ }
/* Example response: !SELRAT: 03, UMTS 3G Preferred */
r = g_regex_new ("!SELRAT:\\s*(\\d+).*$", 0, 0, NULL);
@@ -156,6 +162,11 @@ set_allowed_mode_done (MMAtSerialPort *port,
{
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error)
info->error = g_error_copy (error);
@@ -217,6 +228,11 @@ get_act_request_done (MMAtSerialPort *port,
MMModemGsmAccessTech act = MM_MODEM_GSM_ACCESS_TECH_UNKNOWN;
const char *p;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error)
info->error = g_error_copy (error);
else {
@@ -260,6 +276,11 @@ get_sim_iccid_done (MMAtSerialPort *port,
char buf[21];
int i;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error) {
info->error = g_error_copy (error);
goto done;
@@ -415,7 +436,13 @@ ppp_connect_done (MMModem *modem, GError *error, gpointer user_data)
{
MMCallbackInfo *info = user_data;
- info->error = mm_modem_check_removed (modem, error);
+ /* Do nothing if modem removed */
+ if (!modem || mm_callback_info_check_modem_removed (info))
+ return;
+
+ if (error)
+ info->error = g_error_copy (error);
+
mm_callback_info_schedule (info);
}
@@ -427,6 +454,11 @@ net_activate_done (MMAtSerialPort *port,
{
MMCallbackInfo *info = (MMCallbackInfo *) user_data;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
mm_generic_gsm_connect_complete (MM_GENERIC_GSM (info->modem), error, info);
}
@@ -441,6 +473,11 @@ auth_done (MMAtSerialPort *port,
gint cid;
char *command;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error) {
info->error = g_error_copy (error);
mm_callback_info_schedule (info);
@@ -467,6 +504,11 @@ ps_attach_done (MMAtSerialPort *port,
MMModem *parent_modem_iface;
const char *number;
+ /* If the modem has already been removed, return without
+ * scheduling callback */
+ if (mm_callback_info_check_modem_removed (info))
+ return;
+
if (error) {
info->error = g_error_copy (error);
mm_callback_info_schedule (info);