jtag/drivers/presto: fix potential divide by 0
Found by cppcheck. Change-Id: I656685eb3b639dc054c3a563203264e03d72d1c7 Signed-off-by: Mark O'Donovan <shiftee@posteo.net> Reviewed-on: https://review.openocd.org/c/openocd/+/9498 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
committed by
Antonio Borneo
parent
92dc88978a
commit
b215fe8621
@@ -451,7 +451,7 @@ static struct bitq_interface presto_bitq = {
|
||||
|
||||
static int presto_adapter_khz(int khz, int *jtag_speed)
|
||||
{
|
||||
if (khz < 0) {
|
||||
if (khz <= 0) {
|
||||
*jtag_speed = 0;
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user