* [PATCH] gprs: avoid remove context when context operation is in progress
@ 2016-11-01 6:19 caiwen.zhang
2016-11-01 16:35 ` Denis Kenzior
0 siblings, 1 reply; 3+ messages in thread
From: caiwen.zhang @ 2016-11-01 6:19 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 947 bytes --]
From: Caiwen Zhang <caiwen.zhang@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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gprs: avoid remove context when context operation is in progress
2016-11-01 6:19 [PATCH] gprs: avoid remove context when context operation is in progress caiwen.zhang
@ 2016-11-01 16:35 ` Denis Kenzior
0 siblings, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2016-11-01 16:35 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 358 bytes --]
Hi Caiwen,
On 11/01/2016 01:19 AM, caiwen.zhang(a)intel.com wrote:
> From: Caiwen Zhang <caiwen.zhang@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(-)
>
Applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] gprs: avoid remove context when context operation is in progress
@ 2016-11-01 5:51 caiwen.zhang
0 siblings, 0 replies; 3+ messages in thread
From: caiwen.zhang @ 2016-11-01 5:51 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 947 bytes --]
From: Caiwen Zhang <caiwen.zhang@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
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-01 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 6:19 [PATCH] gprs: avoid remove context when context operation is in progress caiwen.zhang
2016-11-01 16:35 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2016-11-01 5:51 caiwen.zhang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.