core: protect against modem removal in critical callbacks (rh #553953)
There are more places to handle, but these are the most critical. If the modem is removed while a command is in-progress, the mm-callback-info code will set info->modem to NULL. Make sure we check for that in callbacks and return a reasonable error. Previous code would just blindly forge ahead and die on a null dereference.
This commit is contained in:
@@ -38,7 +38,8 @@ enum {
|
||||
MM_MODEM_ERROR_OPERATION_NOT_SUPPORTED = 1,
|
||||
MM_MODEM_ERROR_CONNECTED = 2,
|
||||
MM_MODEM_ERROR_DISCONNECTED = 3,
|
||||
MM_MODEM_ERROR_OPERATION_IN_PROGRESS = 4
|
||||
MM_MODEM_ERROR_OPERATION_IN_PROGRESS = 4,
|
||||
MM_MODEM_ERROR_REMOVED = 5
|
||||
};
|
||||
|
||||
#define MM_MODEM_ERROR (mm_modem_error_quark ())
|
||||
|
Reference in New Issue
Block a user