]> git.gag.com Git - fw/openocd/blobdiff - src/jtag/hla/hla_interface.c
jtag/hla_interface: avoid segfault with adapters that do not have configurable speed
[fw/openocd] / src / jtag / hla / hla_interface.c
index c426f87a1e37d105f500879179b7f61cc4c638bc..21cd06fa733da9b37eac286c954d90864045a7cf 100644 (file)
@@ -150,6 +150,9 @@ int hl_interface_init_reset(void)
 
 static int hl_interface_khz(int khz, int *jtag_speed)
 {
+       if (hl_if.layout->api->speed == NULL)
+               return ERROR_OK;
+
        *jtag_speed = hl_if.layout->api->speed(hl_if.handle, khz, true);
        return ERROR_OK;
 }