Issue was detected by Coverity. ibsim-0.7/ibsim/sim_mad.c:407:31: warning: Access to field 'node' results in a dereference of a null pointer (loaded from variable 'port') // if (!port && !node_get_port(port->node, n)) Signed-off-by: Honggang Li <honli@xxxxxxxxxx> --- ibsim/sim_mad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibsim/sim_mad.c b/ibsim/sim_mad.c index 1660b84dbe4b..a89e2d62afd8 100644 --- a/ibsim/sim_mad.c +++ b/ibsim/sim_mad.c @@ -404,7 +404,7 @@ static int do_sl2vl(Port * port, unsigned op, uint32_t mod, uint8_t * data) n = (mod >> 8) & 0xff; port = node_get_port(port->node, n); n = mod & 0xff; - if (!port && !node_get_port(port->node, n)) + if (!port || !node_get_port(port->node, n)) return ERR_BAD_PARAM; } else n = 0; -- 2.15.0-rc1