aboutsummaryrefslogtreecommitdiffstats
path: root/digilent_spi.c
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2022-06-20 13:31:21 +1000
committerAnastasia Klimchuk <aklm@chromium.org>2022-06-24 00:14:57 +0000
commit6f610a83918b9b1fe9d58578d0d9a8e51a407d6e (patch)
treeb0e8736e9de4a6afb0572161c504e6463a92c1aa /digilent_spi.c
parent970f9481ae23fb11114aaf2f5b103bd0e6e8c5d9 (diff)
downloadflashrom-6f610a83918b9b1fe9d58578d0d9a8e51a407d6e.tar.gz
flashrom-6f610a83918b9b1fe9d58578d0d9a8e51a407d6e.tar.bz2
flashrom-6f610a83918b9b1fe9d58578d0d9a8e51a407d6e.zip
dummyflasher: Handle invalid value of freq parameter
0 is an invalid value for freq parameter and caused floating point exception. This patch checks that freq is not 0 during initialisation. Fixes: https://ticket.coreboot.org/issues/366 TEST=the following scenarios 1) error $ ./flashrom -p dummy:emulate=W25Q128FV,freq=0 -V <...> init_data: invalid value 0 for freq parameter Unhandled programmer parameters (possibly due to another failure): emulate=W25Q128FV, Error: Programmer initialization failed. 2) successful $ ./flashrom -p dummy:emulate=W25Q128FV,freq=10 -V Found Winbond flash chip "W25Q128.V" (16384 kB, SPI). 3) default is also successful $ ./flashrom -p dummy:emulate=W25Q128FV -V Found Winbond flash chip "W25Q128.V" (16384 kB, SPI). Change-Id: I0a95495de0a677f0d4d7f4c2fc61dcbc00d6ad4c Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/65240 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'digilent_spi.c')
0 files changed, 0 insertions, 0 deletions