opensm: Fix a possible dereference of a NULL pointer
Reported by: Coverity Reviewed by: hselasky, kib MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D26233
This commit is contained in:
parent
5dd47b52e5
commit
24e3300159
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364991
@ -1311,6 +1311,14 @@ static void perfmgr_check_overflow(osm_perfmgr_t * pm,
|
|||||||
cl_plock_acquire(&pm->osm->lock);
|
cl_plock_acquire(&pm->osm->lock);
|
||||||
p_node =
|
p_node =
|
||||||
osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid));
|
osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid));
|
||||||
|
if (!p_node) {
|
||||||
|
OSM_LOG(pm->log, OSM_LOG_ERROR,
|
||||||
|
"ERR 5407: Node \"%s\" (guid 0x%" PRIx64
|
||||||
|
") no longer exists so removing from PerfMgr"
|
||||||
|
" monitoring\n",
|
||||||
|
mon_node->name, mon_node->guid);
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
lid = get_lid(p_node, port, mon_node);
|
lid = get_lid(p_node, port, mon_node);
|
||||||
cl_plock_release(&pm->osm->lock);
|
cl_plock_release(&pm->osm->lock);
|
||||||
if (lid == 0) {
|
if (lid == 0) {
|
||||||
@ -1402,6 +1410,14 @@ static void perfmgr_check_pce_overflow(osm_perfmgr_t * pm,
|
|||||||
cl_plock_acquire(&pm->osm->lock);
|
cl_plock_acquire(&pm->osm->lock);
|
||||||
p_node =
|
p_node =
|
||||||
osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid));
|
osm_get_node_by_guid(pm->subn, cl_hton64(mon_node->guid));
|
||||||
|
if (!p_node) {
|
||||||
|
OSM_LOG(pm->log, OSM_LOG_ERROR,
|
||||||
|
"ERR 5407: Node \"%s\" (guid 0x%" PRIx64
|
||||||
|
") no longer exists so removing from PerfMgr"
|
||||||
|
" monitoring\n",
|
||||||
|
mon_node->name, mon_node->guid);
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
lid = get_lid(p_node, port, mon_node);
|
lid = get_lid(p_node, port, mon_node);
|
||||||
cl_plock_release(&pm->osm->lock);
|
cl_plock_release(&pm->osm->lock);
|
||||||
if (lid == 0) {
|
if (lid == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user