]> git.sur5r.net Git - openocd/commitdiff
jtag/hla_interface: avoid segfault with adapters that do not have configurable speed
authorPaul Fertser <fercerpav@gmail.com>
Sat, 17 Jan 2015 18:54:29 +0000 (21:54 +0300)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 26 Jan 2015 20:56:18 +0000 (20:56 +0000)
Change-Id: I0386cbfc85ba8b28d3819530f9950b31545d6821
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2468
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
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;
 }