[PATCH 3/4] rtems: Fix rtems_object_set_name()

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Nov 24 12:52:23 UTC 2020


Return RTEMS_NO_MEMORY if there is not memory available to duplicate the
name.
---
 cpukit/rtems/src/rtemsobjectsetname.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cpukit/rtems/src/rtemsobjectsetname.c b/cpukit/rtems/src/rtemsobjectsetname.c
index 9e1b3a4039..ca663c67cd 100644
--- a/cpukit/rtems/src/rtemsobjectsetname.c
+++ b/cpukit/rtems/src/rtemsobjectsetname.c
@@ -36,6 +36,7 @@ rtems_status_code rtems_object_set_name(
   Objects_Information *information;
   Objects_Control     *the_object;
   Objects_Id           tmpId;
+  Status_Control       status;
 
   if ( !name )
     return RTEMS_INVALID_ADDRESS;
@@ -54,7 +55,7 @@ rtems_status_code rtems_object_set_name(
     return RTEMS_INVALID_ID;
   }
 
-  _Objects_Set_name( information, the_object, name );
+  status = _Objects_Set_name( information, the_object, name );
   _Objects_Allocator_unlock();
-  return RTEMS_SUCCESSFUL;
+  return STATUS_GET_CLASSIC( status );
 }
-- 
2.26.2



More information about the devel mailing list