Skip to content
Snippets Groups Projects
Commit 6c8bd91e authored by Angel Pons's avatar Angel Pons Committed by Edward O'Callaghan
Browse files

Fix segfault when running `flashrom -L`


The raiden_debug programmer is of type USB. However, it does not set the
field `devs.dev`, which will result in a segfault when trying to print
the devices of the non-existing table.

Fix that by replacing `devs.note` with `devs.dev` and adding an empty
device table. Since Device IDs are not used to match programmers,
nothing could be added to the table.

TEST=Running `flashrom -L` no longer segfaults and returns normally.

Change-Id: Ie4171a11384c34abb102d1aadf86aa1b8829fc04
Signed-off-by: default avatarAngel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39826


Tested-by: default avatarbuild bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: default avatarEdward O'Callaghan <quasisec@chromium.org>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: default avatarPaul Menzel <paulepanter@users.sourceforge.net>
parent 548c8807
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,7 @@ const struct programmer_entry programmer_table[] = {
{
.name = "raiden_debug",
.type = USB,
.devs.note = "All programmer devices speaking the raiden protocol\n",
.devs.dev = devs_raiden,
.init = raiden_debug_spi_init,
.map_flash_region = fallback_map,
.unmap_flash_region = fallback_unmap,
......
......@@ -407,6 +407,7 @@ extern const struct dev_entry gfx_nvidia[];
/* raiden_debug_spi.c */
#if CONFIG_RAIDEN == 1
int raiden_debug_spi_init(void);
extern const struct dev_entry devs_raiden[];
#endif
/* drkaiser.c */
......
......@@ -116,6 +116,11 @@
#include <string.h>
#include <unistd.h>
/* FIXME: Add some programmer IDs here */
const struct dev_entry devs_raiden[] = {
{0},
};
#define GOOGLE_VID (0x18D1)
#define GOOGLE_RAIDEN_SPI_SUBCLASS (0x51)
#define GOOGLE_RAIDEN_SPI_PROTOCOL (0x01)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment