diff --git a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst index 4aec7205b928..cb45cd80b225 100644 --- a/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst +++ b/doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst @@ -483,6 +483,10 @@ Modem libraries * Fixed handling of ``%NCELLMEAS`` notification with status 2 (measurement interrupted) and no cells. +* :ref:`modem_key_mgmt` library: + + * Fixed an issue with the :c:func:`modem_key_mgmt_clear` function where it returned ``-ENOENT`` when the credential was cleared. + Multiprotocol Service Layer libraries ------------------------------------- diff --git a/lib/modem_key_mgmt/modem_key_mgmt.c b/lib/modem_key_mgmt/modem_key_mgmt.c index 7e95a9ace307..8b796235038f 100644 --- a/lib/modem_key_mgmt/modem_key_mgmt.c +++ b/lib/modem_key_mgmt/modem_key_mgmt.c @@ -306,7 +306,7 @@ int modem_key_mgmt_clear(nrf_sec_tag_t sec_tag) while (token != NULL) { err = sscanf(token, "%%CMNG: %u,%u,\"", &tag, &type); - if (tag == sec_tag) { + if (tag == sec_tag && err == 2) { err = nrf_modem_at_printf("AT%%CMNG=3,%u,%u", sec_tag, type); } token = strtok(NULL, "\n");