Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/39826 )
Change subject: Fix segfault when running `flashrom -L` ......................................................................
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: Angel Pons th3fanbus@gmail.com --- M flashrom.c M programmer.h M raiden_debug_spi.c 3 files changed, 7 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/26/39826/1
diff --git a/flashrom.c b/flashrom.c index e541b68..081b705 100644 --- a/flashrom.c +++ b/flashrom.c @@ -137,7 +137,7 @@ { .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, diff --git a/programmer.h b/programmer.h index 08500c6..9a41be1 100644 --- a/programmer.h +++ b/programmer.h @@ -407,6 +407,7 @@ /* raiden_debug_spi.c */ #if CONFIG_RAIDEN == 1 int raiden_debug_spi_init(void); +extern const struct dev_entry devs_raiden[]; #endif
/* drkaiser.c */ diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c index 6914455..173e355 100644 --- a/raiden_debug_spi.c +++ b/raiden_debug_spi.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)
Philippe Mathieu-Daudé has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/39826 )
Change subject: Fix segfault when running `flashrom -L` ......................................................................
Patch Set 1: Code-Review+1
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/39826 )
Change subject: Fix segfault when running `flashrom -L` ......................................................................
Patch Set 1: Code-Review+1
(1 comment)
https://review.coreboot.org/c/flashrom/+/39826/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/flashrom/+/39826/1//COMMIT_MSG@13 PS1, Line 13: FIx Fix
Hello build bot (Jenkins), Idwer Vollering, Paul Menzel, David Hendricks, Edward O'Callaghan, Arthur Heymans, Philippe Mathieu-Daudé, HAOUAS Elyes,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/39826
to look at the new patch set (#2).
Change subject: Fix segfault when running `flashrom -L` ......................................................................
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: Angel Pons th3fanbus@gmail.com --- M flashrom.c M programmer.h M raiden_debug_spi.c 3 files changed, 7 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/26/39826/2
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/39826 )
Change subject: Fix segfault when running `flashrom -L` ......................................................................
Patch Set 2:
(1 comment)
https://review.coreboot.org/c/flashrom/+/39826/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/flashrom/+/39826/1//COMMIT_MSG@13 PS1, Line 13: FIx
Fix
D'oh
Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/39826 )
Change subject: Fix segfault when running `flashrom -L` ......................................................................
Patch Set 2: Code-Review+2
Thanks for catching this Angel!
Edward O'Callaghan has submitted this change. ( https://review.coreboot.org/c/flashrom/+/39826 )
Change subject: Fix segfault when running `flashrom -L` ......................................................................
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: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/39826 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Edward O'Callaghan quasisec@chromium.org Reviewed-by: Philippe Mathieu-Daudé f4bug@amsat.org Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net --- M flashrom.c M programmer.h M raiden_debug_spi.c 3 files changed, 7 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Paul Menzel: Looks good to me, but someone else must approve Philippe Mathieu-Daudé: Looks good to me, but someone else must approve Edward O'Callaghan: Looks good to me, approved
diff --git a/flashrom.c b/flashrom.c index e541b68..081b705 100644 --- a/flashrom.c +++ b/flashrom.c @@ -137,7 +137,7 @@ { .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, diff --git a/programmer.h b/programmer.h index 08500c6..9a41be1 100644 --- a/programmer.h +++ b/programmer.h @@ -407,6 +407,7 @@ /* raiden_debug_spi.c */ #if CONFIG_RAIDEN == 1 int raiden_debug_spi_init(void); +extern const struct dev_entry devs_raiden[]; #endif
/* drkaiser.c */ diff --git a/raiden_debug_spi.c b/raiden_debug_spi.c index 6914455..173e355 100644 --- a/raiden_debug_spi.c +++ b/raiden_debug_spi.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)