Skip to contentSkip to conversation

smokey: posix_mutex: Fix mutex/smokey_barrier leak

PATCH Applied Florian Bezdeka 2 participants 2 messages Jul 29, 2021 – Aug 2, 2021

v1 of 5 Applied Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smokey: posix_mutex: Fix mutex/smokey_barrier leak

The mutex of the smokey_barrier used inside protect_handover() was never destroyed. This had side effects when trying to extend the test suite with an additional function that had a mutex located on the same address than the never cleaned up smokey_barrier lock.

---
 testsuite/smokey/posix-mutex/posix-mutex.c | 2 ++
 1 file changed, 2 insertions(+)
testsuite/smokey/posix-mutex/posix-mutex.c +2 -0
index 9a55d0973..e5793c42c 100644
@@ -997,6 +997,8 @@ static int protect_handover(void)
 	if (!__T(ret, pthread_mutex_destroy(&mutex)))
 		return ret;
 
+	smokey_barrier_destroy(&barrier);
+
 	return 0;
 }
 
Signature · 1 line
2.30.2
Applied
#1 lore raw
Quoted 16 lines · Florian Bezdeka

The mutex of the smokey_barrier used inside protect_handover() was never destroyed. This had side effects when trying to extend the test suite with an additional function that had a mutex located on the same address than the never cleaned up smokey_barrier lock.

---
 testsuite/smokey/posix-mutex/posix-mutex.c | 2 ++
 1 file changed, 2 insertions(+)
testsuite/smokey/posix-mutex/posix-mutex.c +0 -0
index 9a55d0973..e5793c42c 100644

testsuite/smokey/posix-mutex/posix-mutex.c static int protect_handover(void) · line 1004

Quoted 8 lines
testsuite/smokey/posix-mutex/posix-mutex.c +2 -0
@@ -997,6 +997,8 @@ static int protect_handover(void)
 	if (!__T(ret, pthread_mutex_destroy(&mutex)))
 		return ret;
 
+	smokey_barrier_destroy(&barrier);
+
 	return 0;
 }
 

Thanks, applied.

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux