summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectallocate.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-11 20:10:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-11 20:10:37 +0000
commit404903b033a58e3724b718773d750009e26a8d26 (patch)
tree3968bb5bbf3ef6f58b7d26c036bbce9169a4a31d /cpukit/score/src/objectallocate.c
parent2007-05-11 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-404903b033a58e3724b718773d750009e26a8d26.tar.bz2
2007-05-11 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/coremsgseize.c: A blocking sender's message size was pulled out of the wrong field in the Wait information structure. * score/src/objectallocate.c: With the new optional manager support, we only stub out the initialization. This makes it possible to attempt to create an object with the information structure only initialized with all zeros. This ensures we return an error cleanly in this case.
Diffstat (limited to 'cpukit/score/src/objectallocate.c')
-rw-r--r--cpukit/score/src/objectallocate.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/cpukit/score/src/objectallocate.c b/cpukit/score/src/objectallocate.c
index c2a6b5efe2..c924f39453 100644
--- a/cpukit/score/src/objectallocate.c
+++ b/cpukit/score/src/objectallocate.c
@@ -42,8 +42,22 @@ Objects_Control *_Objects_Allocate(
Objects_Information *information
)
{
- Objects_Control *the_object =
- (Objects_Control *) _Chain_Get( &information->Inactive );
+ Objects_Control *the_object;
+
+ /*
+ * If the application is using the optional manager stubs and
+ * still attempts to create the object, the information block
+ * should be all zeroed out because it is in the BSS. So let's
+ * check that code for this manager is even present.
+ */
+ if ( information->size == 0 )
+ return NULL;
+
+ /*
+ * OK. The manager should be initialized and configured to have objects.
+ * With any luck, it is safe to attempt to allocate an object.
+ */
+ the_object = (Objects_Control *) _Chain_Get( &information->Inactive );
if ( information->auto_extend ) {
/*