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:
@@ -11,7 +11,7 @@
|
||||
* GNU General Public License for more details:
|
||||
*
|
||||
* Copyright (C) 2008 Novell, Inc.
|
||||
* Copyright (C) 2009 Red Hat, Inc.
|
||||
* Copyright (C) 2009 - 2010 Red Hat, Inc.
|
||||
*/
|
||||
|
||||
#include "mm-errors.h"
|
||||
@@ -72,6 +72,7 @@ mm_modem_error_get_type (void)
|
||||
ENUM_ENTRY (MM_MODEM_ERROR_CONNECTED, "Connected"),
|
||||
ENUM_ENTRY (MM_MODEM_ERROR_DISCONNECTED, "Disconnected"),
|
||||
ENUM_ENTRY (MM_MODEM_ERROR_OPERATION_IN_PROGRESS, "OperationInProgress"),
|
||||
ENUM_ENTRY (MM_MODEM_ERROR_REMOVED, "Removed"),
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user