fix coverity errors

Change-Id: I3b769026fce71493447b77773315fee020b46272
Signed-off-by: Eyal Salomon <esalomon@mellanox.com>