[rtems commit] rtems: Fix rtems_semaphore_create()

Sebastian Huber sebh at rtems.org
Thu Jun 16 08:50:55 UTC 2016


Module:    rtems
Branch:    master
Commit:    57c676c626268aa8457e1de81921b68418a32ff5
Changeset: http://git.rtems.org/rtems/commit/?id=57c676c626268aa8457e1de81921b68418a32ff5

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Jun 16 10:44:00 2016 +0200

rtems: Fix rtems_semaphore_create()

Destroy the thread queue in case of a priority ceiling violation,
otherwise the SMP profiling data gets corrupted.

---

 cpukit/rtems/src/semcreate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
index 0f8bdcb..bb1c6b4 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;
       }



More information about the vc mailing list