[openib-general] [PATCH] OpenSM:

Hal Rosenstock halr at voltaire.com
Fri Nov 18 06:11:09 PST 2005


Hi Yael,

While investigating the SA MCMemberRecord segfault just patched, I
stumbled across the following and thought it would be better handled as
follows since the consumer does not check the returned contents of
*pp_mcm_port. Let me know what you think about the below patch. Thanks.

-- Hal

In osm_multicast.c::osm_mgrp_is_port_present, also determine return
value based on whether p_map_item is NULL.

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: opensm/osm_multicast.c
===================================================================
--- opensm/osm_multicast.c      (revision 4077)
+++ opensm/osm_multicast.c      (working copy)
@@ -257,14 +257,16 @@ osm_mgrp_is_port_present(
   {
     if (pp_mcm_port)
       *pp_mcm_port = (osm_mcm_port_t *)p_map_item;
-    return TRUE;
+    if (p_map_item)
+      return TRUE;
+    else
+      return FALSE;
   }
   if (pp_mcm_port)
     *pp_mcm_port = NULL;
   return FALSE;
 }
 
-
 /**********************************************************************
  **********************************************************************/
 static void







More information about the general mailing list