[ofa-general] [PATCH] osm: QoS parser - checking allocation status

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Mon Sep 17 15:23:44 PDT 2007


Checking memory allocation status is qos
policy parser to prevent seg. fault.

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_qos_parser.y |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/opensm/opensm/osm_qos_parser.y b/opensm/opensm/osm_qos_parser.y
index a73cf6b..3c54205 100644
--- a/opensm/opensm/osm_qos_parser.y
+++ b/opensm/opensm/osm_qos_parser.y
@@ -2216,9 +2216,10 @@ static void __parser_add_port_to_port_map(
            osm_physp_get_port_guid(p_physp))) == cl_qmap_end(p_map))
     {
         osm_qos_port_t * p_port = osm_qos_policy_port_create(p_physp);
-        cl_qmap_insert(p_map,
-                       cl_ntoh64(osm_physp_get_port_guid(p_physp)),
-                       &p_port->map_item);
+        if (p_port)
+            cl_qmap_insert(p_map,
+                           cl_ntoh64(osm_physp_get_port_guid(p_physp)),
+                           &p_port->map_item);
     }
 }

-- 
1.5.1.4





More information about the general mailing list