summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-08-03 11:20:46 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-08-03 11:20:46 -0700
commitbbc2a56986b5b2b3ed80e8d1bdbb1ff9ed28d3ec (patch)
tree9f38572a89048e447cde9b4d2548df641720a7a8 /src
parentfbec2de66009afe7ab8a49d1b26deacf98dad381 (diff)
downloadofono-bbc2a56986b5b2b3ed80e8d1bdbb1ff9ed28d3ec.tar.bz2
Fix over-complicated code flow that results in uninitialized variables
Diffstat (limited to 'src')
-rw-r--r--src/network.c5
-rw-r--r--src/sim.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/src/network.c b/src/network.c
index 33a1f65a..3686614b 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1261,12 +1261,15 @@ static void sim_pnn_read_cb(struct ofono_modem *modem, int ok,
sim_eons_add_pnn_record(netreg->eons, record, data, record_length);
+ if (record != total)
+ return;
+
check:
/* If PNN is not present then OPL is not useful, don't
* retrieve it. If OPL is not there then PNN[1] will
* still be used for the HPLMN and/or EHPLMN, if PNN
* is present. */
- if ((record == total || !ok) && !sim_eons_pnn_is_empty(netreg->eons))
+ if (!sim_eons_pnn_is_empty(netreg->eons))
ofono_sim_read(modem, SIM_EFOPL_FILEID, sim_opl_read_cb, NULL);
}
diff --git a/src/sim.c b/src/sim.c
index 93f230d8..d432e1ba 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -201,8 +201,11 @@ static void sim_msisdn_read_cb(struct ofono_modem *modem, int ok,
sim->own_numbers = g_slist_prepend(sim->own_numbers, ph);
+ if (record != total)
+ return;
+
check:
- if ((record == total || !ok) && sim->own_numbers) {
+ if (sim->own_numbers) {
char **own_numbers;
DBusConnection *conn = ofono_dbus_get_connection();