fix coverity errors

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