All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Fix primary context active/deactive result d-bus reply missing issue
@ 2011-04-27  7:04 martin.xu
  2011-05-08 16:06 ` Denis Kenzior
  2011-05-11 18:31 ` Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: martin.xu @ 2011-04-27  7:04 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1670 bytes --]

From: Martin Xu <martin.xu@intel.com>

If user offline modem when the gprs_context is in enabling or disabling
state(activating/disactivating), the GPRS primary context activate/disactivate
result will not be replied to the corresponding application.
---
 drivers/atmodem/gprs-context.c |    7 +++++++
 src/gprs.c                     |    5 +++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
index ba95cbf..bfbd2c5 100644
--- a/drivers/atmodem/gprs-context.c
+++ b/drivers/atmodem/gprs-context.c
@@ -301,6 +301,13 @@ static void at_gprs_context_remove(struct ofono_gprs_context *gc)
 
 	if (gcd->state != STATE_IDLE && gcd->ppp) {
 		g_at_ppp_unref(gcd->ppp);
+
+		if (gcd->state == STATE_ENABLING)
+			CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
+
+		if (gcd->state == STATE_DISABLING)
+			CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
+
 		g_at_chat_resume(gcd->chat);
 	}
 
diff --git a/src/gprs.c b/src/gprs.c
index deffeb8..99cb55d 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -351,6 +351,9 @@ static struct pri_context *gprs_context_by_path(struct ofono_gprs *gprs,
 
 static void context_settings_free(struct context_settings *settings)
 {
+	if (settings == NULL)
+		return;
+
 	if (settings->ipv4) {
 		g_free(settings->ipv4->ip);
 		g_free(settings->ipv4->netmask);
@@ -736,6 +739,8 @@ static void pri_reset_context_settings(struct pri_context *ctx)
 		return;
 
 	settings = ctx->context_driver->settings;
+	if (settings == NULL)
+		return;
 
 	interface = settings->interface;
 	settings->interface = NULL;
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-12  1:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-27  7:04 [PATCH 1/1] Fix primary context active/deactive result d-bus reply missing issue martin.xu
2011-05-08 16:06 ` Denis Kenzior
2011-05-11 18:31 ` Denis Kenzior
2011-05-12  1:01   ` Xu, Martin

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.