Fixes to Klockwork reported issues

Klockwork reporting nullptr dereferencing and
iteration end check. This change fixes those.

Tested: Tested BMC booting fine in PFR mode.

Signed-off-by: Vikram Bodireddy <vikram.bodireddy@linux.intel.com>
Change-Id: I3239957446b0d49295007901f9daf0356eafabec
2 files changed