Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] bug in mca_mpool_base_module_create()
From: Roberto Ammendola (roberto.ammendola_at_[hidden])
Date: 2009-04-20 10:39:49


I found a small bug in function mca_mpool_base_module_create() where if a
bad name is provided for mpool component, last iterated component is
returned, instead of NULL. I suggest a solution:

===================================================================
--- ompi/mca/mpool/base/mpool_base_lookup.c (revision 21042)
+++ ompi/mca/mpool/base/mpool_base_lookup.c (working copy)
@@ -75,11 +75,14 @@
     for (item = opal_list_get_first(&mca_mpool_base_components);
          item != opal_list_get_end(&mca_mpool_base_components);
          item = opal_list_get_next(item)) {
+ mca_mpool_base_component_t* c;
+
          mca_base_component_list_item_t *cli =
            (mca_base_component_list_item_t *) item;
- component =
+ c =
            (mca_mpool_base_component_t *) cli->cli_component;
- if(0 == strcmp(component->mpool_version.mca_component_name,
name)) {
+ if(0 == strcmp(c->mpool_version.mca_component_name, name)) {
+ component = c;
              break;
          }
     }