summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-16 10:44:00 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-16 10:44:00 +0200
commit57c676c626268aa8457e1de81921b68418a32ff5 (patch)
treee68175d87f99937cbc22b2decab44ccf4892f258
parent661e0e6377b16cb52c46c87877ed182bcf39ef01 (diff)
downloadrtems-57c676c626268aa8457e1de81921b68418a32ff5.tar.bz2
rtems: Fix rtems_semaphore_create()
Destroy the thread queue in case of a priority ceiling violation, otherwise the SMP profiling data gets corrupted.
-rw-r--r--cpukit/rtems/src/semcreate.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
index 0f8bdcbbe5..bb1c6b4e61 100644
--- a/cpukit/rtems/src/semcreate.c
+++ b/cpukit/rtems/src/semcreate.c
@@ -173,6 +173,10 @@ rtems_status_code rtems_semaphore_create(
executing,
&queue_context
);
+
+ if ( status != STATUS_SUCCESSFUL ) {
+ _Thread_queue_Destroy( &the_semaphore->Core_control.Wait_queue );
+ }
} else {
status = STATUS_SUCCESSFUL;
}