All of lore.kernel.org
 help / color / mirror / Atom feed
* Fix issues in ofono_sim_get_phase and its usage
@ 2010-12-06 18:39 Jeevaka Badrappan
  2010-12-06 18:39 ` [PATCH 1/2] sim: fix minor issue in ofono_sim_get_phase Jeevaka Badrappan
  2010-12-06 18:39 ` [PATCH 2/2] simfs: Add unknown sim phase check Jeevaka Badrappan
  0 siblings, 2 replies; 5+ messages in thread
From: Jeevaka Badrappan @ 2010-12-06 18:39 UTC (permalink / raw)
  To: ofono

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

Hi,

 Following patch adds the missing OFONO_SIM_PHASE_UNKNOWN check in some
of the functions which uses ofono_sim_get_phase. Also fixed the issue
in ofono_get_sim_phase when the passed sim paramter is NULL. 
 
Jeevaka Badrappan (2):
  sim: fix minor issue in ofono_sim_get_phase
  simfs: Add unknown sim phase check

 src/sim.c   |    2 +-
 src/simfs.c |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)


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

* [PATCH 1/2] sim: fix minor issue in ofono_sim_get_phase
  2010-12-06 18:39 Fix issues in ofono_sim_get_phase and its usage Jeevaka Badrappan
@ 2010-12-06 18:39 ` Jeevaka Badrappan
  2010-12-12 10:38   ` Denis Kenzior
  2010-12-06 18:39 ` [PATCH 2/2] simfs: Add unknown sim phase check Jeevaka Badrappan
  1 sibling, 1 reply; 5+ messages in thread
From: Jeevaka Badrappan @ 2010-12-06 18:39 UTC (permalink / raw)
  To: ofono

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

---
 src/sim.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/sim.c b/src/sim.c
index c523982..6217a25 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1914,7 +1914,7 @@ const char *ofono_sim_get_imsi(struct ofono_sim *sim)
 enum ofono_sim_phase ofono_sim_get_phase(struct ofono_sim *sim)
 {
 	if (sim == NULL)
-		return 0;
+		return OFONO_SIM_PHASE_UNKNOWN;
 
 	return sim->phase;
 }
-- 
1.7.0.4


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

* [PATCH 2/2] simfs: Add unknown sim phase check
  2010-12-06 18:39 Fix issues in ofono_sim_get_phase and its usage Jeevaka Badrappan
  2010-12-06 18:39 ` [PATCH 1/2] sim: fix minor issue in ofono_sim_get_phase Jeevaka Badrappan
@ 2010-12-06 18:39 ` Jeevaka Badrappan
  2010-12-12 10:41   ` Denis Kenzior
  1 sibling, 1 reply; 5+ messages in thread
From: Jeevaka Badrappan @ 2010-12-06 18:39 UTC (permalink / raw)
  To: ofono

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

---
 src/simfs.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/simfs.c b/src/simfs.c
index 8e52f7b..617af14 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -554,7 +554,8 @@ static gboolean sim_fs_op_check_cached(struct sim_fs *fs)
 	enum ofono_sim_file_structure structure;
 	int record_length;
 
-	if (imsi == NULL || op->info_only == TRUE)
+	if (imsi == NULL || phase == OFONO_SIM_PHASE_UNKNOWN ||
+			op->info_only == TRUE)
 		return FALSE;
 
 	path = g_strdup_printf(SIM_CACHE_PATH, imsi, phase, op->id);
@@ -836,6 +837,9 @@ char *sim_fs_get_cached_image(struct sim_fs *fs, int id)
 		return NULL;
 
 	phase = ofono_sim_get_phase(fs->sim);
+	if (phase == OFONO_SIM_PHASE_UNKNOWN)
+		return NULL;
+
 	path = g_strdup_printf(SIM_IMAGE_CACHE_PATH, imsi, phase, id);
 
 	TFR(stat(path, &st_buf));
@@ -907,6 +911,9 @@ void sim_fs_check_version(struct sim_fs *fs)
 	int len;
 	char *path;
 
+	if (imsi == NULL || phase == OFONO_SIM_PHASE_UNKNOWN)
+		return;
+
 	if (read_file(&version, 1, SIM_CACHE_VERSION, imsi, phase) == 1)
 		if (version == SIM_FS_VERSION)
 			return;
-- 
1.7.0.4


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

* Re: [PATCH 1/2] sim: fix minor issue in ofono_sim_get_phase
  2010-12-06 18:39 ` [PATCH 1/2] sim: fix minor issue in ofono_sim_get_phase Jeevaka Badrappan
@ 2010-12-12 10:38   ` Denis Kenzior
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2010-12-12 10:38 UTC (permalink / raw)
  To: ofono

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

Hi Jeevaka,

On 12/06/2010 12:39 PM, Jeevaka Badrappan wrote:
> ---
>  src/sim.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

* Re: [PATCH 2/2] simfs: Add unknown sim phase check
  2010-12-06 18:39 ` [PATCH 2/2] simfs: Add unknown sim phase check Jeevaka Badrappan
@ 2010-12-12 10:41   ` Denis Kenzior
  0 siblings, 0 replies; 5+ messages in thread
From: Denis Kenzior @ 2010-12-12 10:41 UTC (permalink / raw)
  To: ofono

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

Hi Jeevaka,

On 12/06/2010 12:39 PM, Jeevaka Badrappan wrote:
> ---
>  src/simfs.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 

Patch has been applied, thanks.

Regards,
-Denis

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

end of thread, other threads:[~2010-12-12 10:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-06 18:39 Fix issues in ofono_sim_get_phase and its usage Jeevaka Badrappan
2010-12-06 18:39 ` [PATCH 1/2] sim: fix minor issue in ofono_sim_get_phase Jeevaka Badrappan
2010-12-12 10:38   ` Denis Kenzior
2010-12-06 18:39 ` [PATCH 2/2] simfs: Add unknown sim phase check Jeevaka Badrappan
2010-12-12 10:41   ` 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.