diff --git a/src/target/adiv5.c b/src/target/adiv5.c index d567161c7d2..804c23f69e3 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -990,6 +990,7 @@ void adiv5_dp_init(adiv5_debug_port_s *const dp) */ if (target->priv_free == cortex_priv_free && cortex_ap(target) == ap && strstr(target->driver, "Tiva") != NULL) { + adiv5_ap_unref(ap); adiv5_dp_unref(dp); return; }