Issue was detected by Coverity. This less-than-zero comparison of an unsigned value is never true. "mod < 0U". 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 a89e2d62afd8..b6e24881fb9e 100644 --- a/ibsim/sim_mad.c +++ b/ibsim/sim_mad.c @@ -711,7 +711,7 @@ static int do_linearforwtbl(Port * port, unsigned op, uint32_t mod, if (!sw) // not a Switch? return ERR_ATTR_UNSUPPORTED; - if (mod < 0 || mod > 767) + if (mod > 767) return ERR_BAD_PARAM; if (op == IB_MAD_METHOD_SET) -- 2.15.0-rc1