From: Paul Fertser Date: Sat, 17 Jan 2015 18:54:29 +0000 (+0300) Subject: jtag/hla_interface: avoid segfault with adapters that do not have configurable speed X-Git-Tag: v0.9.0-rc1~181 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9a160c63341b1f55a69da81914c71c98ec998108;p=openocd jtag/hla_interface: avoid segfault with adapters that do not have configurable speed Change-Id: I0386cbfc85ba8b28d3819530f9950b31545d6821 Signed-off-by: Paul Fertser Reviewed-on: http://openocd.zylin.com/2468 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/jtag/hla/hla_interface.c b/src/jtag/hla/hla_interface.c index c426f87a..21cd06fa 100644 --- a/src/jtag/hla/hla_interface.c +++ b/src/jtag/hla/hla_interface.c @@ -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; }