Attention is currently required from: Felix Singer, Edward O'Callaghan, Angel Pons, Alexander Goncharov.

Alexander Goncharov uploaded patch set #5 to this change.

View Change

flashrom: rewrite flashbuses_to_text()

The previous implementation had no error handling, as a result the
flashrom could crash if the computer ran out of memory. The new
version returns NULL in such cases.

Also rewrite lots of `if` conditions to one cycle, store a name of
buses in an array.

The caller always expected a non-null value, so change its behavior to
handle possible null value. As far as `printf()` and `free()` can
handle null pointers, do nothing with such callers.

Change-Id: I59b9044c99b4ba6c00d8c97f1e91af09d70dce2c
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Ticket: https://ticket.coreboot.org/issues/408
---
M flashrom.c
M print.c
2 files changed, 67 insertions(+), 19 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/39/73039/5

To view, visit change 73039. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I59b9044c99b4ba6c00d8c97f1e91af09d70dce2c
Gerrit-Change-Number: 73039
Gerrit-PatchSet: 5
Gerrit-Owner: Alexander Goncharov <chat@joursoir.net>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Attention: Felix Singer <felixsinger@posteo.net>
Gerrit-Attention: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Attention: Angel Pons <th3fanbus@gmail.com>
Gerrit-Attention: Alexander Goncharov <chat@joursoir.net>
Gerrit-MessageType: newpatchset