Fix coverity errors

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