From 766009b4f19ecdb7f193c683ca60d6d8570f15c5 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 23 Nov 2020 17:24:39 +0100 Subject: rtems: Fix rtems_object_set_name() 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 86cb4dac83..71be850069 100644 --- a/cpukit/rtems/src/rtemsobjectsetname.c +++ b/cpukit/rtems/src/rtemsobjectsetname.c @@ -37,6 +37,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; @@ -55,7 +56,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 ); } -- cgit v1.2.3