From: openocd-gerrit <ope...@us...> - 2025-02-16 16:31:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via ed4e58410446343a485625ee2722144cc23d55a6 (commit) from 71f92c94468f370be80ce60dd76d5d924ddba69a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ed4e58410446343a485625ee2722144cc23d55a6 Author: Tomas Vanek <va...@fb...> Date: Mon Feb 3 21:45:07 2025 +0100 jtag/core: fix segfault when adapter driver has no reset method xlnx-pcie-xvc and linuxspidev adapter drivers does not implement the reset method. Although it is likely both adapters will implement the method in the near future, avoid segfault and return an error instead. Change-Id: If8ddf165dbc563cf6d64b2094968151075778ba7 Signed-off-by: Tomas Vanek <va...@fb...> Fixes: commit 8850eb8f2c51 ("swd: get rid of jtag queue to assert/deassert srst") Reviewed-on: https://review.openocd.org/c/openocd/+/8735 Reviewed-by: Antonio Borneo <bor...@gm...> Tested-by: jenkins diff --git a/src/jtag/core.c b/src/jtag/core.c index 89d53aecb..030c173be 100644 --- a/src/jtag/core.c +++ b/src/jtag/core.c @@ -631,6 +631,13 @@ static int adapter_system_reset(int req_srst) /* Maybe change SRST signal state */ if (jtag_srst != req_srst) { + if (!adapter_driver->reset) { + if (req_srst) + LOG_ERROR("Adapter driver does not implement SRST handling"); + + return ERROR_NOT_IMPLEMENTED; + } + retval = adapter_driver->reset(0, req_srst); if (retval != ERROR_OK) { LOG_ERROR("SRST error"); ----------------------------------------------------------------------- Summary of changes: src/jtag/core.c | 7 +++++++ 1 file changed, 7 insertions(+) hooks/post-receive -- Main OpenOCD repository |