Fixing coverity errors

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