[ofa-general] Re: [PATCH 6/7] Add node-name-map support to OpenSM; using the "default" map.

Ira Weiny weiny2 at llnl.gov
Mon Nov 5 12:19:05 PST 2007


On Sun, 4 Nov 2007 23:13:52 +0200
Sasha Khapyorsky <sashak at voltaire.com> wrote:

> On 20:15 Thu 01 Nov     , Ira Weiny wrote:
> > From 35280cfd5229ccc8d91b6fd98e0f4b58193d0d03 Mon Sep 17 00:00:00 2001
> > From: Ira K. Weiny <weiny2 at llnl.gov>
> > Date: Thu, 1 Nov 2007 19:41:37 -0700
> > Subject: [PATCH] Add node-name-map support to OpenSM; using the "default" map.
> > 

<snip>

> > Signed-off-by: Ira K. Weiny <weiny2 at llnl.gov>
> > diff --git a/opensm/opensm/osm_node.c b/opensm/opensm/osm_node.c
> > index 645daa9..f34da1f 100644
> > --- a/opensm/opensm/osm_node.c
> > +++ b/opensm/opensm/osm_node.c
> > @@ -131,6 +131,7 @@ osm_node_t *osm_node_new(IN const osm_madw_t * const p_madw)
> >  
> >  		osm_node_init_physp(p_node, p_madw);
> >  	}
> > +	p_node->print_desc = "<unknown>";
> >  
> >  	return (p_node);
> >  }
> > @@ -146,6 +147,11 @@ static void osm_node_destroy(IN osm_node_t * p_node)
> >  	 */
> >  	for (i = 0; i < p_node->physp_tbl_size; i++)
> >  		osm_physp_destroy(&p_node->physp_table[i]);
> > +
> > +	/* cleanup printable node_desc field */
> > +	if (p_node->print_desc) {
> > +		free(p_node->print_desc);
> > +	}
> >  }
> >  
> >  /**********************************************************************
> 
> p_node->print_desc is initialized as constant string and later freed as
> dynamically allocated memory. I think there are paths when
> osm_node_destroy() could run before __osm_nd_rcv_process_nd(). If so it
> it looks like a bug?
> 

yep, that is a bug, sorry...  New patch with fix is attached.

Ira

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-node-name-map-support-to-OpenSM-using-the-defa.patch
Type: application/octet-stream
Size: 4904 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20071105/672f88af/attachment.obj>


More information about the general mailing list