rtems: Fix rtems_object_set_name()

Return RTEMS_NO_MEMORY if there is not memory available to duplicate the
name.
This commit is contained in:
Sebastian Huber
2020-11-23 17:24:39 +01:00
parent 13bab346c5
commit 766009b4f1

View File

@@ -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 );
}