From 6c8bd91e29719b9db2198d6ebf1ea33a26f9f5aa Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 25 Mar 2020 13:35:45 +0100 Subject: Fix segfault when running `flashrom -L` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Angel Pons Reviewed-on: https://review.coreboot.org/c/flashrom/+/39826 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Paul Menzel --- raiden_debug_spi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'raiden_debug_spi.c') diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c index 691445545..173e35542 100644 --- a/raiden_debug_spi.c +++ b/raiden_debug_spi.c @@ -116,6 +116,11 @@ #include #include +/* 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) -- cgit v1.2.3