sim: Fix use of uninitialized values
authorDenis Kenzior <denkenz@gmail.com>
Tue, 19 Jun 2012 17:57:53 +0000 (12:57 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Tue, 19 Jun 2012 17:59:42 +0000 (12:59 -0500)
In the case of an error, sim_pin_query_cb should not assume the
pin_type value is valid.

src/sim.c

index 9fea5fd..33543ed 100644 (file)
--- 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: