[ofa-general] opensm/libvendor/osm_vendor_ibumad_sa.c: In __osmv_sa_mad_rcv_cb, handle attribute offset of 0
Hal Rosenstock
hrosenstock at xsigo.com
Mon Dec 10 04:23:40 PST 2007
opensm/libvendor/osm_vendor_ibumad_sa.c: In __osmv_sa_mad_rcv_cb, handle
attribute offset of 0 which is valid at IBA 1.2.1 when 0 attributes are
returned
Signed-off-by: Hal Rosenstock <hal at xsigo.com>
diff --git a/opensm/libvendor/osm_vendor_ibumad_sa.c b/opensm/libvendor/osm_vendor_ibumad_sa.c
index b06cc69..5ce8fad 100644
--- a/opensm/libvendor/osm_vendor_ibumad_sa.c
+++ b/opensm/libvendor/osm_vendor_ibumad_sa.c
@@ -137,20 +137,23 @@ __osmv_sa_mad_rcv_cb(IN osm_madw_t * p_madw,
else
query_res.result_cnt = 1;
#else
- /* we used the offset value to calculate the number of
- records in here */
- query_res.result_cnt = (uintn_t)
- ((p_madw->mad_size - IB_SA_MAD_HDR_SIZE) /
- ib_get_attr_size(p_sa_mad->attr_offset));
- osm_log(p_bind->p_log, OSM_LOG_DEBUG,
- "__osmv_sa_mad_rcv_cb: Count = %u = %zu / %u (%zu)\n",
- query_res.result_cnt,
- p_madw->mad_size - IB_SA_MAD_HDR_SIZE,
- ib_get_attr_size(p_sa_mad->attr_offset),
- (p_madw->mad_size -
- IB_SA_MAD_HDR_SIZE) %
- ib_get_attr_size(p_sa_mad->attr_offset)
- );
+ if (ib_get_attr_size(p_sa_mad->attr_offset)) {
+ /* we used the offset value to calculate the
+ number of records in here */
+ query_res.result_cnt = (uintn_t)
+ ((p_madw->mad_size - IB_SA_MAD_HDR_SIZE) /
+ ib_get_attr_size(p_sa_mad->attr_offset));
+ osm_log(p_bind->p_log, OSM_LOG_DEBUG,
+ "__osmv_sa_mad_rcv_cb: Count = %u = %zu / %u (%zu)\n",
+ query_res.result_cnt,
+ p_madw->mad_size - IB_SA_MAD_HDR_SIZE,
+ ib_get_attr_size(p_sa_mad->attr_offset),
+ (p_madw->mad_size -
+ IB_SA_MAD_HDR_SIZE) %
+ ib_get_attr_size(p_sa_mad->attr_offset)
+ );
+ } else
+ query_res.result_cnt = 0;
#endif
}
}
More information about the general
mailing list