From 6b2acc0243f6dd54823c336ded8c20d16cdc50a3 Mon Sep 17 00:00:00 2001 From: Girts Folkmanis Date: Fri, 3 Mar 2017 09:49:58 -0800 Subject: [PATCH] arm_dpm: fix dpm setup When ARM64 support was being merged, a comparison ended up being inverted. This causes NULL pointer access when target attempts to use core cache. Change-Id: Ic8873ddd13dbdd8100856a71b4717f44cd336e23 Signed-off-by: Girts Folkmanis Signed-off-by: Matthias Welwarsky Reviewed-on: http://openocd.zylin.com/4042 Reviewed-by: Matthias Welwarsky Tested-by: jenkins Reviewed-by: Paul Fertser --- src/target/arm_dpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/arm_dpm.c b/src/target/arm_dpm.c index f15bff75..3e8180c3 100644 --- a/src/target/arm_dpm.c +++ b/src/target/arm_dpm.c @@ -973,7 +973,7 @@ int arm_dpm_setup(struct arm_dpm *dpm) arm->read_core_reg = arm_dpm_read_core_reg; arm->write_core_reg = arm_dpm_write_core_reg; - if (arm->core_cache != NULL) { + if (arm->core_cache == NULL) { cache = arm_build_reg_cache(target, arm); if (!cache) return ERROR_FAIL; -- 2.39.5