jtag/drivers/ulink: fix clang static analyzer warning
scan-build-9: Description: Access to field 'payload_in' results in a dereference of a null pointer (loaded from field 'queue_start') File: src/jtag/drivers/ulink.c Line: 2216 Set input/output_signals conditionally if ulink_append_get_signals_cmd() and ulink_execute_queued_commands() returns no error. Do not fail driver initialisation as the signals are only printed. Change-Id: I6c842f0e9a604712abf7444a2fa95ba5810de1ff Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Reviewed-on: http://openocd.zylin.com/5520 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
This commit is contained in:
parent
c064440162
commit
6dcd255b7b
|
@ -2210,14 +2210,17 @@ static int ulink_init(void)
|
||||||
}
|
}
|
||||||
ulink_clear_queue(ulink_handle);
|
ulink_clear_queue(ulink_handle);
|
||||||
|
|
||||||
ulink_append_get_signals_cmd(ulink_handle);
|
ret = ulink_append_get_signals_cmd(ulink_handle);
|
||||||
ulink_execute_queued_commands(ulink_handle, 200);
|
if (ret == ERROR_OK)
|
||||||
|
ret = ulink_execute_queued_commands(ulink_handle, 200);
|
||||||
|
|
||||||
/* Post-process the single CMD_GET_SIGNALS command */
|
if (ret == ERROR_OK) {
|
||||||
input_signals = ulink_handle->queue_start->payload_in[0];
|
/* Post-process the single CMD_GET_SIGNALS command */
|
||||||
output_signals = ulink_handle->queue_start->payload_in[1];
|
input_signals = ulink_handle->queue_start->payload_in[0];
|
||||||
|
output_signals = ulink_handle->queue_start->payload_in[1];
|
||||||
|
|
||||||
ulink_print_signal_states(input_signals, output_signals);
|
ulink_print_signal_states(input_signals, output_signals);
|
||||||
|
}
|
||||||
|
|
||||||
ulink_clear_queue(ulink_handle);
|
ulink_clear_queue(ulink_handle);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue