target/armv7m: fix static analyzer warning
[fw/openocd] / src / target / armv8_dpm.c
index 1e88a445fdbc8bcd36f782ae82a356c1da3f79b9..e7d0f864e81aba2fccab5c33337c8fbbd0d7a567 100644 (file)
@@ -1465,8 +1465,10 @@ int armv8_dpm_setup(struct arm_dpm *dpm)
        }
 
        /* watchpoint setup */
-       target->type->add_watchpoint = dpmv8_add_watchpoint;
-       target->type->remove_watchpoint = dpmv8_remove_watchpoint;
+       if (!target->type->add_watchpoint) {
+               target->type->add_watchpoint = dpmv8_add_watchpoint;
+               target->type->remove_watchpoint = dpmv8_remove_watchpoint;
+       }
 
        /* FIXME add vector catch support */