On 1/2/2019 8:13 AM, Honggang Li wrote: > node->sw->fdb[to] is uint8_t. So, (node->sw->fdb[to] < 0) is always > false. > > Issue was detected by Coverity. > > Signed-off-by: Honggang Li <honli@xxxxxxxxxx> > --- > ibsim/sim_cmd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c > index e2fe6ba6dddb..1d36c600814f 100644 > --- a/ibsim/sim_cmd.c > +++ b/ibsim/sim_cmd.c > @@ -751,8 +751,8 @@ static int dump_route(FILE * f, char *line) > break; // found > outport = portnum; > if (node->type == SWITCH_NODE) { > - if ((outport = node->sw->fdb[to]) < 0 > - || to > node->sw->linearFDBtop) > + outport = node->sw->fdb[to]; > + if (to > node->sw->linearFDBtop) This is not the proper fix. I think that the check should be == 0xff rather than < 0 or eliminated as in this patch since fdb is initialized to 0xff (no port for LID). -- Hal > goto badtbl; > port = ports + node->portsbase + outport; > if (outport == 0) { >