cdma: prevent crash on modem removal (rh #571921)
This commit is contained in:
@@ -1847,10 +1847,9 @@ simple_state_machine (MMModem *modem, GError *error, gpointer user_data)
|
|||||||
const char *str;
|
const char *str;
|
||||||
guint id;
|
guint id;
|
||||||
|
|
||||||
if (error) {
|
info->error = mm_modem_check_removed (modem, error);
|
||||||
info->error = g_error_copy (error);
|
if (info->error)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case SIMPLE_STATE_BEGIN:
|
case SIMPLE_STATE_BEGIN:
|
||||||
@@ -1885,6 +1884,7 @@ simple_state_machine (MMModem *modem, GError *error, gpointer user_data)
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
if (info->error || state == SIMPLE_STATE_DONE) {
|
if (info->error || state == SIMPLE_STATE_DONE) {
|
||||||
|
if (modem)
|
||||||
registration_cleanup (MM_GENERIC_CDMA (modem), 0, 0);
|
registration_cleanup (MM_GENERIC_CDMA (modem), 0, 0);
|
||||||
mm_callback_info_schedule (info);
|
mm_callback_info_schedule (info);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user