futility: check flashrom return code and bail with error

During the flashrom initialization sequence the return code is not
being checked therefore there's a potential that the code moves
forward with read/write operation even with outstanding error.

This CL checks the return code and bail with error.

BUG=b:217629892
TEST=Test futility update with multiple instances of flashrom running.
BRANCH=None

Signed-off-by: YH Lin <yueherngl@chromium.org>
Change-Id: I0768232f6af35290ad7b3d9f479ee299bf9400e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3485520
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
1 file changed