mbm: Fix segfault with hot-plugged MD300 modem
authorDenis Kenzior <denkenz@gmail.com>
Thu, 17 Oct 2013 20:24:56 +0000 (15:24 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Thu, 17 Oct 2013 20:25:52 +0000 (15:25 -0500)
plugins/mbm.c

index 328833f..7d6f92a 100644 (file)
@@ -262,6 +262,10 @@ static void emrdy_query(gboolean ok, GAtResult *result, gpointer user_data)
        if (ok)
                return;
 
+       /* Sometimes we query EMRDY just as the EMRDY notifier is fired */
+       if (data->flags & MBM_FLAG_SAW_EMRDY)
+               return;
+
        /* On some MBM hardware the EMRDY cannot be queried, so if this fails
         * we try to run CFUN? to check the state.  CFUN? will fail unless
         * EMRDY: 1 has been sent, in which case the emrdy_notifier should be