All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] simfs: fix GLib-CRITICAL issue occuring when there is no SIM card.
@ 2011-03-09 12:32 Lucas, GuillaumeX
  2011-03-11 21:46 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Lucas, GuillaumeX @ 2011-03-09 12:32 UTC (permalink / raw)
  To: ofono

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

From: Guillaume Lucas <guillaumex.lucas@intel.com>

During modem release, when there is no SIM card, a GLib-CRITICAL
issue occurs during the free of the sim fs context.
---
 src/simfs.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/simfs.c b/src/simfs.c
index 3a97a10..49f79dd 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -166,21 +166,23 @@ void sim_fs_context_free(struct ofono_sim_context *context)
 	int n = 0;
 	struct sim_fs_op *op;
 
-	while ((op = g_queue_peek_nth(fs->op_q, n)) != NULL) {
-		if (op->context != context) {
-			n += 1;
-			continue;
-		}
+	if (fs->op_q) {
+		while ((op = g_queue_peek_nth(fs->op_q, n)) != NULL) {
+			if (op->context != context) {
+				n += 1;
+				continue;
+			}
 
-		if (n == 0) {
-			op->cb = NULL;
+			if (n == 0) {
+				op->cb = NULL;
 
-			n += 1;
-			continue;
-		}
+				n += 1;
+				continue;
+			}
 
-		sim_fs_op_free(op);
-		g_queue_remove(fs->op_q, op);
+			sim_fs_op_free(op);
+			g_queue_remove(fs->op_q, op);
+		}
 	}
 
 	if (context->file_watches)
-- 
1.6.3.3

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


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

* Re: [PATCH] simfs: fix GLib-CRITICAL issue occuring when there is no SIM card.
  2011-03-09 12:32 [PATCH] simfs: fix GLib-CRITICAL issue occuring when there is no SIM card Lucas, GuillaumeX
@ 2011-03-11 21:46 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-03-11 21:46 UTC (permalink / raw)
  To: ofono

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

Hi Guillaume,

On 03/09/2011 06:32 AM, Lucas, GuillaumeX wrote:
> From: Guillaume Lucas <guillaumex.lucas@intel.com>
> 
> During modem release, when there is no SIM card, a GLib-CRITICAL
> issue occurs during the free of the sim fs context.
> ---
>  src/simfs.c |   26 ++++++++++++++------------
>  1 files changed, 14 insertions(+), 12 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2011-03-11 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-09 12:32 [PATCH] simfs: fix GLib-CRITICAL issue occuring when there is no SIM card Lucas, GuillaumeX
2011-03-11 21:46 ` Denis Kenzior

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.