All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 2/2] emulator: Fix crash when dundee is disconnecting
  2012-06-25 14:19 ` [PATCH 2/2] emulator: Fix crash when dundee is disconnecting Guillaume Zajac
@ 2012-06-22  7:46   ` Denis Kenzior
  2012-06-26  8:00     ` Guillaume Zajac
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Kenzior @ 2012-06-22  7:46 UTC (permalink / raw)
  To: ofono

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

Hi Guillaume,

On 06/25/2012 09:19 AM, Guillaume Zajac wrote:
> Dundee is not waiting to receive the NO CARRIER notification
> to close the IO channel with oFono so that oFono is trying to
> send a NO CARRIER although GAtServer is removed.
> ---
>   src/emulator.c |    9 ++++++++-
>   1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/src/emulator.c b/src/emulator.c
> index c3165eb..cbee6ad 100644
> --- a/src/emulator.c
> +++ b/src/emulator.c
> @@ -101,7 +101,14 @@ static void cleanup_ppp(struct ofono_emulator *em)
>   	em->pns_id = 0;
>
>   	g_at_server_resume(em->server);
> -	g_at_server_send_final(em->server, G_AT_SERVER_RESULT_NO_CARRIER);
> +
> +	/*
> +	 * If GAtServer IO is lost, GAtServer can have been removed
> +	 * through emulator disconnect routine.
> +	 */
> +	if (em->server != NULL)
> +		g_at_server_send_final(em->server,
> +					G_AT_SERVER_RESULT_NO_CARRIER);

If server is NULL then either it should be a global check like before 
(prior to proposed patch 1), or you should add a NULL check to 
g_at_server_send_final itself.

>   }
>
>   static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)

Regards,
-Denis

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

* [PATCH 1/2] emulator: Test already done in g_at_server_resume()
@ 2012-06-25 14:19 Guillaume Zajac
  2012-06-25 14:19 ` [PATCH 2/2] emulator: Fix crash when dundee is disconnecting Guillaume Zajac
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Zajac @ 2012-06-25 14:19 UTC (permalink / raw)
  To: ofono

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

---
 src/emulator.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index e7c7d41..c3165eb 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -100,9 +100,6 @@ static void cleanup_ppp(struct ofono_emulator *em)
 	__ofono_private_network_release(em->pns_id);
 	em->pns_id = 0;
 
-	if (em->server == NULL)
-		return;
-
 	g_at_server_resume(em->server);
 	g_at_server_send_final(em->server, G_AT_SERVER_RESULT_NO_CARRIER);
 }
-- 
1.7.5.4


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

* [PATCH 2/2] emulator: Fix crash when dundee is disconnecting
  2012-06-25 14:19 [PATCH 1/2] emulator: Test already done in g_at_server_resume() Guillaume Zajac
@ 2012-06-25 14:19 ` Guillaume Zajac
  2012-06-22  7:46   ` Denis Kenzior
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Zajac @ 2012-06-25 14:19 UTC (permalink / raw)
  To: ofono

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

Dundee is not waiting to receive the NO CARRIER notification
to close the IO channel with oFono so that oFono is trying to
send a NO CARRIER although GAtServer is removed.
---
 src/emulator.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index c3165eb..cbee6ad 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -101,7 +101,14 @@ static void cleanup_ppp(struct ofono_emulator *em)
 	em->pns_id = 0;
 
 	g_at_server_resume(em->server);
-	g_at_server_send_final(em->server, G_AT_SERVER_RESULT_NO_CARRIER);
+
+	/*
+	 * If GAtServer IO is lost, GAtServer can have been removed
+	 * through emulator disconnect routine.
+	 */
+	if (em->server != NULL)
+		g_at_server_send_final(em->server,
+					G_AT_SERVER_RESULT_NO_CARRIER);
 }
 
 static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
-- 
1.7.5.4


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

* Re: [PATCH 2/2] emulator: Fix crash when dundee is disconnecting
  2012-06-22  7:46   ` Denis Kenzior
@ 2012-06-26  8:00     ` Guillaume Zajac
  0 siblings, 0 replies; 4+ messages in thread
From: Guillaume Zajac @ 2012-06-26  8:00 UTC (permalink / raw)
  To: ofono

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

Hi Denis,

>> Dundee is not waiting to receive the NO CARRIER notification
>> to close the IO channel with oFono so that oFono is trying to
>> send a NO CARRIER although GAtServer is removed.
>> ---
>>   src/emulator.c |    9 ++++++++-
>>   1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/emulator.c b/src/emulator.c
>> index c3165eb..cbee6ad 100644
>> --- a/src/emulator.c
>> +++ b/src/emulator.c
>> @@ -101,7 +101,14 @@ static void cleanup_ppp(struct ofono_emulator *em)
>>       em->pns_id = 0;
>>
>>       g_at_server_resume(em->server);
>> -    g_at_server_send_final(em->server, G_AT_SERVER_RESULT_NO_CARRIER);
>> +
>> +    /*
>> +     * If GAtServer IO is lost, GAtServer can have been removed
>> +     * through emulator disconnect routine.
>> +     */
>> +    if (em->server != NULL)
>> +        g_at_server_send_final(em->server,
>> +                    G_AT_SERVER_RESULT_NO_CARRIER);
>
> If server is NULL then either it should be a global check like before 
> (prior to proposed patch 1), or you should add a NULL check to 
> g_at_server_send_final itself.

In this specific case the server is removed during g_at_server_resume(), 
so I will add the NULL check into g_at_server_send_final()

>
>>   }
>>
>>   static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer 
>> user_data)
>
> Regards,
> -Denis
>

Kind regards,
Guillaume

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

end of thread, other threads:[~2012-06-26  8:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25 14:19 [PATCH 1/2] emulator: Test already done in g_at_server_resume() Guillaume Zajac
2012-06-25 14:19 ` [PATCH 2/2] emulator: Fix crash when dundee is disconnecting Guillaume Zajac
2012-06-22  7:46   ` Denis Kenzior
2012-06-26  8:00     ` Guillaume Zajac

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.