From 72ce19bf3e87b5e73c053f7ea1095a5006f1aea9 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Tue, 19 Jun 2012 12:57:53 -0500 Subject: [PATCH] sim: Fix use of uninitialized values In the case of an error, sim_pin_query_cb should not assume the pin_type value is valid. --- src/sim.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/sim.c b/src/sim.c index 9fea5fd5..33543eda 100644 --- a/src/sim.c +++ b/src/sim.c @@ -2689,8 +2689,7 @@ static void sim_pin_query_cb(const struct ofono_error *error, if (error->type != OFONO_ERROR_TYPE_NO_ERROR) { ofono_error("Querying PIN authentication state failed"); - - goto checkdone; + return; } if (sim->pin_type != pin_type) { @@ -2728,7 +2727,6 @@ static void sim_pin_query_cb(const struct ofono_error *error, sim_pin_retries_check(sim); -checkdone: switch (pin_type) { case OFONO_SIM_PASSWORD_SIM_PIN2: case OFONO_SIM_PASSWORD_SIM_PUK2: