Fixed few coverity patches

Signed-off-by: Santhosh Edukulla <santhosh.edukulla@gmail.com>