diff --git a/src/netconf_subscribed_notifications.c b/src/netconf_subscribed_notifications.c index 4b340269..c55952cc 100644 --- a/src/netconf_subscribed_notifications.c +++ b/src/netconf_subscribed_notifications.c @@ -1688,7 +1688,7 @@ sub_ntf_terminate_sub(struct np2srv_sub_ntf *sub, struct nc_session *ncs) sub_id_count = ATOMIC_LOAD_RELAXED(sub->sub_id_count); for (idx = 0; idx < sub_id_count; ++idx) { /* pass the lock to the notification CB, which removes its sub ID, the final one the whole sub */ - sub_id = sub->sub_ids[0]; + sub_id = sub->sub_ids[idx]; sub_ntf_cb_lock_pass(sub_id); if (ncs) { r = sr_unsubscribe_sub(np2srv.sr_notif_sub, sub_id);