summaryrefslogtreecommitdiff
path: root/plugins/arm
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-06-05 18:31:45 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-06-05 18:31:45 (GMT)
commit4b36edf684b49eb5584f8f0c5aff3dd7aac2c834 (patch)
tree527b2829dbb525a8819731bb2e146aafe575987e /plugins/arm
parent09d390300548fce2912f47114265c484b89c5012 (diff)
Released the mutex even in case of register loading failure.
Diffstat (limited to 'plugins/arm')
-rw-r--r--plugins/arm/v7/registers/banked.c7
-rw-r--r--plugins/arm/v7/registers/basic.c7
-rw-r--r--plugins/arm/v7/registers/coproc.c7
-rw-r--r--plugins/arm/v7/registers/simd.c7
-rw-r--r--plugins/arm/v7/registers/special.c7
5 files changed, 20 insertions, 15 deletions
diff --git a/plugins/arm/v7/registers/banked.c b/plugins/arm/v7/registers/banked.c
index bce48dd..72274a6 100644
--- a/plugins/arm/v7/registers/banked.c
+++ b/plugins/arm/v7/registers/banked.c
@@ -683,11 +683,12 @@ static GArchRegister *get_armv7_banked_register(BankedRegisterTarget target)
result = _armv7_banked_registers[target];
- G_UNLOCK(_av7_banked_reg_mutex);
+ bad_values:
- g_object_ref(G_OBJECT(result));
+ G_UNLOCK(_av7_banked_reg_mutex);
- bad_values:
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
return result;
diff --git a/plugins/arm/v7/registers/basic.c b/plugins/arm/v7/registers/basic.c
index aed9001..7194c7f 100644
--- a/plugins/arm/v7/registers/basic.c
+++ b/plugins/arm/v7/registers/basic.c
@@ -418,11 +418,12 @@ static GArchRegister *get_armv7_basic_register(uint8_t index)
result = _armv7_basic_registers[index];
- G_UNLOCK(_av7_basic_reg_mutex);
+ bad_index:
- g_object_ref(G_OBJECT(result));
+ G_UNLOCK(_av7_basic_reg_mutex);
- bad_index:
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
return result;
diff --git a/plugins/arm/v7/registers/coproc.c b/plugins/arm/v7/registers/coproc.c
index f1dc3bc..f13a7aa 100644
--- a/plugins/arm/v7/registers/coproc.c
+++ b/plugins/arm/v7/registers/coproc.c
@@ -398,11 +398,12 @@ static GArchRegister *get_armv7_cp_register(uint8_t index)
result = _armv7_cp_registers[index];
- G_UNLOCK(_av7_cp_reg_mutex);
+ bad_index:
- g_object_ref(G_OBJECT(result));
+ G_UNLOCK(_av7_cp_reg_mutex);
- bad_index:
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
return result;
diff --git a/plugins/arm/v7/registers/simd.c b/plugins/arm/v7/registers/simd.c
index 1a71fc7..d762d90 100644
--- a/plugins/arm/v7/registers/simd.c
+++ b/plugins/arm/v7/registers/simd.c
@@ -486,11 +486,12 @@ static GArchRegister *get_armv7_simd_register(SIMDRegisterMapping mapping, uint8
result = _armv7_simd_registers[mapping][index];
- G_UNLOCK(_av7_simd_reg_mutex);
+ bad_index:
- g_object_ref(G_OBJECT(result));
+ G_UNLOCK(_av7_simd_reg_mutex);
- bad_index:
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
return result;
diff --git a/plugins/arm/v7/registers/special.c b/plugins/arm/v7/registers/special.c
index ce3d859..8f80c71 100644
--- a/plugins/arm/v7/registers/special.c
+++ b/plugins/arm/v7/registers/special.c
@@ -442,11 +442,12 @@ static GArchRegister *get_armv7_special_register(SpecRegTarget target)
result = _armv7_special_registers[target];
- G_UNLOCK(_av7_special_reg_mutex);
+ bad_index:
- g_object_ref(G_OBJECT(result));
+ G_UNLOCK(_av7_special_reg_mutex);
- bad_index:
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
return result;