From: Caiwen Zhang <caiwen.zhang(a)intel.com>
If remove the context before context activation / deactivation is
completed, it may cause crash.
---
src/gprs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gprs.c b/src/gprs.c
index 3a4a819..4aa00f9 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -2154,13 +2154,13 @@ static DBusMessage *gprs_remove_context(DBusConnection *conn,
if (ctx == NULL)
return __ofono_error_not_found(msg);
+ /* This context is already being messed with */
+ if (ctx->pending)
+ return __ofono_error_busy(msg);
+
if (ctx->active) {
struct ofono_gprs_context *gc = ctx->context_driver;
- /* This context is already being messed with */
- if (ctx->pending)
- return __ofono_error_busy(msg);
-
gprs->pending = dbus_message_ref(msg);
gc->driver->deactivate_primary(gc, ctx->context.cid,
gprs_deactivate_for_remove, ctx);
--
1.9.1
Show replies by date